I have nuget packages hosted on GitHub Packages. Then, when I try to list the packages in the github nuget feed using nuget.exe, it tells me that it can't list the packages in the feed:
> nuget list -Source "https://nuget.pkg.github.com/mabead/index.json"
WARNING: This version of nuget.exe does not support listing packages from package source 'https://nuget.pkg.github.com/mabead/index.json'.
No packages found.
Note that the packages are properly listed in Visual Studio when I use the window that opens up after clicking on "Manage Nuget Packages for Solution". So the feed works but it does not work with the nuget cli.
I am using version 5.5.1 of nuget.exe.
Any idea what I am using to be able to list the packages using the CLI?
This beahvior is caused by the fact that not all nuget server expose the same set of API. The full set of possibly implemented APIs is defined here.
Let's compare the service index of nuget.org with the one of GitHub. The one of nuget.org is available here and it contains a very extensive set of APIs.
{
"version": "3.0.0",
"resources": [
{
"#id": "https://azuresearch-usnc.nuget.org/query",
"#type": "SearchQueryService",
"comment": "Query endpoint of NuGet Search service (primary)"
},
{
"#id": "https://azuresearch-ussc.nuget.org/query",
"#type": "SearchQueryService",
"comment": "Query endpoint of NuGet Search service (secondary)"
},
{
"#id": "https://azuresearch-usnc.nuget.org/autocomplete",
"#type": "SearchAutocompleteService",
"comment": "Autocomplete endpoint of NuGet Search service (primary)"
},
{
"#id": "https://azuresearch-ussc.nuget.org/autocomplete",
"#type": "SearchAutocompleteService",
"comment": "Autocomplete endpoint of NuGet Search service (secondary)"
},
{
"#id": "https://azuresearch-usnc.nuget.org/",
"#type": "SearchGalleryQueryService/3.0.0-rc",
"comment": "Azure Website based Search Service used by Gallery (primary)"
},
{
"#id": "https://azuresearch-ussc.nuget.org/",
"#type": "SearchGalleryQueryService/3.0.0-rc",
"comment": "Azure Website based Search Service used by Gallery (secondary)"
},
{
"#id": "https://api.nuget.org/v3/registration5-semver1/",
"#type": "RegistrationsBaseUrl",
"comment": "Base URL of Azure storage where NuGet package registration info is stored"
},
{
"#id": "https://api.nuget.org/v3-flatcontainer/",
"#type": "PackageBaseAddress/3.0.0",
"comment": "Base URL of where NuGet packages are stored, in the format https://api.nuget.org/v3-flatcontainer/{id-lower}/{version-lower}/{id-lower}.{version-lower}.nupkg"
},
{
"#id": "https://www.nuget.org/api/v2",
"#type": "LegacyGallery"
},
{
"#id": "https://www.nuget.org/api/v2",
"#type": "LegacyGallery/2.0.0"
},
{
"#id": "https://www.nuget.org/api/v2/package",
"#type": "PackagePublish/2.0.0"
},
{
"#id": "https://www.nuget.org/api/v2/symbolpackage",
"#type": "SymbolPackagePublish/4.9.0",
"comment": "The gallery symbol publish endpoint."
},
{
"#id": "https://azuresearch-usnc.nuget.org/query",
"#type": "SearchQueryService/3.0.0-rc",
"comment": "Query endpoint of NuGet Search service (primary) used by RC clients"
},
{
"#id": "https://azuresearch-ussc.nuget.org/query",
"#type": "SearchQueryService/3.0.0-rc",
"comment": "Query endpoint of NuGet Search service (secondary) used by RC clients"
},
{
"#id": "https://azuresearch-usnc.nuget.org/autocomplete",
"#type": "SearchAutocompleteService/3.0.0-rc",
"comment": "Autocomplete endpoint of NuGet Search service (primary) used by RC clients"
},
{
"#id": "https://azuresearch-ussc.nuget.org/autocomplete",
"#type": "SearchAutocompleteService/3.0.0-rc",
"comment": "Autocomplete endpoint of NuGet Search service (secondary) used by RC clients"
},
{
"#id": "https://api.nuget.org/v3/registration5-semver1/",
"#type": "RegistrationsBaseUrl/3.0.0-rc",
"comment": "Base URL of Azure storage where NuGet package registration info is stored used by RC clients. This base URL does not include SemVer 2.0.0 packages."
},
{
"#id": "https://www.nuget.org/packages/{id}/{version}/ReportAbuse",
"#type": "ReportAbuseUriTemplate/3.0.0-rc",
"comment": "URI template used by NuGet Client to construct Report Abuse URL for packages used by RC clients"
},
{
"#id": "https://api.nuget.org/v3/registration5-semver1/{id-lower}/index.json",
"#type": "PackageDisplayMetadataUriTemplate/3.0.0-rc",
"comment": "URI template used by NuGet Client to construct display metadata for Packages using ID"
},
{
"#id": "https://api.nuget.org/v3/registration5-semver1/{id-lower}/{version-lower}.json",
"#type": "PackageVersionDisplayMetadataUriTemplate/3.0.0-rc",
"comment": "URI template used by NuGet Client to construct display metadata for Packages using ID, Version"
},
{
"#id": "https://azuresearch-usnc.nuget.org/query",
"#type": "SearchQueryService/3.0.0-beta",
"comment": "Query endpoint of NuGet Search service (primary) used by beta clients"
},
{
"#id": "https://azuresearch-ussc.nuget.org/query",
"#type": "SearchQueryService/3.0.0-beta",
"comment": "Query endpoint of NuGet Search service (secondary) used by beta clients"
},
{
"#id": "https://azuresearch-usnc.nuget.org/autocomplete",
"#type": "SearchAutocompleteService/3.0.0-beta",
"comment": "Autocomplete endpoint of NuGet Search service (primary) used by beta clients"
},
{
"#id": "https://azuresearch-ussc.nuget.org/autocomplete",
"#type": "SearchAutocompleteService/3.0.0-beta",
"comment": "Autocomplete endpoint of NuGet Search service (secondary) used by beta clients"
},
{
"#id": "https://api.nuget.org/v3/registration5-semver1/",
"#type": "RegistrationsBaseUrl/3.0.0-beta",
"comment": "Base URL of Azure storage where NuGet package registration info is stored used by Beta clients. This base URL does not include SemVer 2.0.0 packages."
},
{
"#id": "https://www.nuget.org/packages/{id}/{version}/ReportAbuse",
"#type": "ReportAbuseUriTemplate/3.0.0-beta",
"comment": "URI template used by NuGet Client to construct Report Abuse URL for packages"
},
{
"#id": "https://www.nuget.org/packages/{id}/{version}?_src=template",
"#type": "PackageDetailsUriTemplate/5.1.0",
"comment": "URI template used by NuGet Client to construct details URL for packages"
},
{
"#id": "https://api.nuget.org/v3/registration5-gz-semver1/",
"#type": "RegistrationsBaseUrl/3.4.0",
"comment": "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL does not include SemVer 2.0.0 packages."
},
{
"#id": "https://api.nuget.org/v3/registration5-gz-semver2/",
"#type": "RegistrationsBaseUrl/3.6.0",
"comment": "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages."
},
{
"#id": "https://api.nuget.org/v3/registration5-gz-semver2/",
"#type": "RegistrationsBaseUrl/Versioned",
"clientVersion": "4.3.0-alpha",
"comment": "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages."
},
{
"#id": "https://api.nuget.org/v3-index/repository-signatures/4.7.0/index.json",
"#type": "RepositorySignatures/4.7.0",
"comment": "The endpoint for discovering information about this package source's repository signatures."
},
{
"#id": "https://api.nuget.org/v3-index/repository-signatures/5.0.0/index.json",
"#type": "RepositorySignatures/5.0.0",
"comment": "The endpoint for discovering information about this package source's repository signatures."
},
{
"#id": "https://api.nuget.org/v3/catalog0/index.json",
"#type": "Catalog/3.0.0",
"comment": "Index of the NuGet package catalog."
}
],
"#context": {
"#vocab": "http://schema.nuget.org/services#",
"comment": "http://www.w3.org/2000/01/rdf-schema#comment"
}
}
The one of GitHub available here contains a much more limited set of supported APIs:
{
"version": "3.0.0-beta.1",
"resources": [
{
"#id": "https://nuget.pkg.github.com/mabead/download",
"#type": "PackageBaseAddress/3.0.0",
"comment": "Get package content (.nupkg)."
},
{
"#id": "https://nuget.pkg.github.com/mabead/query",
"#type": "SearchQueryService",
"comment": "Filter and search for packages by keyword."
},
{
"#id": "https://nuget.pkg.github.com/mabead/query",
"#type": "SearchQueryService/3.0.0-beta",
"comment": "Filter and search for packages by keyword."
},
{
"#id": "https://nuget.pkg.github.com/mabead/query",
"#type": "SearchQueryService/3.0.0-rc",
"comment": "Filter and search for packages by keyword."
},
{
"#id": "https://nuget.pkg.github.com/mabead",
"#type": "PackagePublish/2.0.0",
"comment": "Push and delete (or unlist) packages."
},
{
"#id": "https://nuget.pkg.github.com/mabead",
"#type": "RegistrationsBaseUrl",
"comment": "Get package metadata."
},
{
"#id": "https://nuget.pkg.github.com/mabead",
"#type": "RegistrationsBaseUrl/3.0.0-beta",
"comment": "Get package metadata."
},
{
"#id": "https://nuget.pkg.github.com/mabead",
"#type": "RegistrationsBaseUrl/3.0.0-rc",
"comment": "Get package metadata."
}
]
}
So, the API required to execute nuget.exe list is supported by nuget.org but not by GitHub, thus explaining the warning explained in the console.
As a workaround, if you know a partial name, at the very least you can find out the latest version of a package, or set of packages.
I know that's not a solution: it is not the same as getting a list of all available packages. But it gives you important info: whether or not a new package is available that's higher than your current one.
The command:
nuget search "XYZ" -Source "https://nuget.pkg.github.com/Company-Name/index.json" -PreRelease
Replace XYZ with a substring of a known package. Replace Company-Name with your company name, or whatever the location of your packages index.json is.
The option -PreRelease at the end does what you'd expect: it includes pre-releases.
Related
I am trying to set up Schema.org on a website, but I have trouble understanding how to use the #id attribute.
I want to specify a Corporation and a WebSite. Here is the code without a reference between the two objects:
<script type="application/ld+json">
[{
"#context": "https://schema.org",
"#id": "https://www.example.com/#corporation",
"#type": "Corporation",
"name": "Company Name",
"legalName": "Company Name",
"description": "Company Description",
"url": "https://www.example.com",
"logo": "https://www.example.com/logo"
},
{
"#context": "https://schema.org",
"#type": "WebSite",
"name": "Example",
"url": "https://www.example.com"
}]]
</script>
The Schema.org validator finds both the Corporation and the WebSite. Google's Rich result test tool finds the logotype, as expected. Now, I want to add a reference to the Corporation as the publisher of the WebSite.
<script type="application/ld+json">
[{
"#context": "https://schema.org",
"#id": "https://www.example.com/#corporation",
"#type": "Corporation",
"name": "Company Name",
"legalName": "Company Name",
"description": "Company Description",
"url": "https://www.example.com",
"logo": "https://www.example.com/logo"
},
{
"#context": "https://schema.org",
"#type": "WebSite",
"name": "Example",
"url": "https://www.example.com",
"publisher": {
"#id": "https://www.example.com/#corporation"
}
}]]
</script>
The Schema.org validator now only shows the WebSite and has inlined the Corporation as publisher. The Google tool does not find any objects, but I was expecting it to still find the logotype.
I have spent quite some time with the Schema.org docs and searched the internet but I can't find an explanation to this behavior.
Am I doing it the wrong way? Thanks in advance.
At the moment logo is only shown in reports if it is in a top-level Organization entity. It is still recognised internally.
Google's logic sometimes ignores embedded entities.
I found a reference from Google on this. Point 2:
I need this Id upfront but I can't seem to find it anywhere online?
The documentation only refers to it as a system variable.
Context:
I have multiple projects and I want to identify a project during CI so it can run a powershell script hosted in another repository.
You can get the all team projects id with REST Api:
https://dev.azure.com/{organization}/_apis/projects?api-version=5.0-preview.3
Results:
{
"count": 3,
"value": [
{
"id": "eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
"name": "Fabrikam-Fiber-TFVC",
"description": "Team Foundation Version Control projects.",
"url": "https://dev.azure.com/fabrikam/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
"state": "wellFormed"
},
{
"id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
"name": "Fabrikam-Fiber-Git",
"description": "Git projects",
"url": "https://dev.azure.com/fabrikam/_apis/projects/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
"state": "wellFormed"
},
{
"id": "281f9a5b-af0d-49b4-a1df-fe6f5e5f84d0",
"name": "TestGit",
"url": "https://dev.azure.com/fabrikam/_apis/projects/281f9a5b-af0d-49b4-a1df-fe6f5e5f84d0",
"state": "wellFormed"
}
]
}
You don't even need use Postman or create Http request, just enter the API url above in the browser.
You can examine the HTML in the UI of the dashboard on your organisation projects page:
I am building a web application for product comparison. The website has a structure like so:
http://example.com
http://example.com/fr/compare/
http://example.com/es/compare/
etc..
The main page is in English.
I want to insert Schema.org for each of the pages and I've construed this schema. Written in square brackets are what I intend to put as value later on.
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#id": "[canonical-url-for-specific-language]#webapp",
"#type": "WebApplication",
"name": "[Product Comparison Title in specific language]",
"url": "[canonica url for specific language]",
"applicationCategory": "Utility",
"applicationSubCategory": "Product Comparison",
"about": "[page-description]",
"browserRequirements": "Requires JavaScript. Requires HTML5.",
"softwareVersion": "1.0.0",
"screenshot": "[image-url]",
"inLanguage": "[language-code]",
"softwareHelp": {
"#type": "CreativeWork",
"url": "[link-to-how-to-page-for-specific-language]"
},
"operatingSystem": "All"
}
</script>
How can I construct this JSON-LD well to work for my specific website.
If you use structured data for a home page that has a language selector, then the markup can be similar to the following:
{
"#context": "https://schema.org",
"#id": "[canonical-url-for-specific-language]#webapp",
"#type": "WebApplication",
"name": "[Product Comparison Title in specific language]",
"url": "[canonica url for specific language]",
"applicationCategory": "Utility",
"applicationSubCategory": "Product Comparison",
"about": "[page-description]",
"browserRequirements": "Requires JavaScript. Requires HTML5.",
"softwareVersion": "1.0.0",
"screenshot": "[image-url]",
"inLanguage":[{
"#type": "Language",
"name": "English",
"alternateName": "en",
"additionalType":"https://www.loc.gov/standards/iso639-2/php/code_list.php",
"sameAs":"https://en.wikipedia.org/wiki/English_language"
},
{
"#type": "Language",
"name": "Spanish",
"alternateName": "es",
"additionalType":"https://www.loc.gov/standards/iso639-2/php/code_list.php",
"sameAs":"https://en.wikipedia.org/wiki/Spanish_language"
}],
"softwareHelp": {
"#type": "CreativeWork",
"name":"Customer Service and Support",
"url": [
"https://examples.com/en/help.html",
"https://examples.com/es/help.html"
]
},
"operatingSystem": "All"
}
Note that I have here used for each language two identifiers with the properties sameAs and additionalType.
If the web page is with one particular language, then just delete the part of the markup for the unnecessary language and the square brackets.
Check out this markup on the Google testing tool and note that there are two warnings that are useful to fix.
I'm trying to accomplish machine-understandable relationship descriptions for companies/subsidiaries and their websites. Let's suppose there is one parent company with two subsidiaries, all of which have their own websites. I deploy one Organization script, and one WebSite script per home page.
The parent organization's JSON-LD reads:
<script type="application/ld+json">
{
"#context": "http://www.schema.org",
"#type": "Organization",
"#id": "https://www.parentorg.com/#organization",
"name": "Parent Org",
"legalName": "Parent Org Inc.",
"description": "Description of company",
"foundingDate": "1978",
"logo": "https://www.parentorg.com/images/logo.png",
"image": "https://www.parentorg.com/de/images/outside.jpg",
"url": "https://www.parentorg.com/",
"address": {
"#type": "PostalAddress",
"streetAddress": "Street 110",
"addressLocality": "City",
"postalCode": "XX XXX",
"addressCountry": "XX"
},
"contactPoint": {
"#type": "ContactPoint",
"contactType": "customer support",
"telephone": "+12-345-678-91011",
"email": "contact#parentorg.com"
},
"sameAs": [
"https://twitter.com/parentorg/",
"https://www.instagram.com/parentorg/",
"https://www.youtube.com/user/parentorg/",
"https://plus.google.com/parentorg"
],
"subOrganization": [
{
"#type": "Organization",
"#id": "https://www.subsidiary-one.de/#organization",
"name": "Subsidiary One"
},
{
"#type": "Organization",
"#id": "https://www.subsidiary-two.de/#organization",
"name": "Subsidiary Two"
}
]
}
</script>
The parent's website JSON-LD is:
<script type="application/ld+json">
{
"#context": "http://schema.org",
"#type": "WebSite",
"#id": "https://www.parentorg.com/#website",
"url": "https://www.parentorg.com/",
"author": {
"#type": "Organization",
"#id": "https://www.parentorg.com/#organization",
"name": "Parent Org"
}
}
</script>
And now the subsidiaries' organization JSON-LD contain a parentOrganization property:
"parentOrganization": {
"#type": "Organization",
"#id": "https://www.parentorg.com/#organization",
"name": "Parent Org"
}
Would this be a good way to cross-reference those entities? And do I even need to write out the name properties inside subOrganization, parentOrganization, and author, when there are URIs referenced?
Yes, you follow the best practice how to cross-reference entities (by giving each entity an #id that is different from the url).
You don’t have to provide additional properties when referencing entities, so this is fine:
"author": {"#id": "https://www.parentorg.com/#organization"}
"subOrganization": [
{"#id": "https://www.subsidiary-one.de/#organization"},
{"#id": "https://www.subsidiary-two.de/#organization"}
]
"parentOrganization": {"#id": "https://www.parentorg.com/#organization"}
However, this of course requires that consumers fetch the referenced documents. But not all do (probably). So if you want to provide data for those consumers, too, you could add properties in addition to the #id. It could be just one, a few, or even all properties. I think the two from your example are the most important ones:
Providing #type can also be useful for consumers that are capable of fetching documents, as it may allow them to decide whether the referenced resource is of interest to them before fetching it. For example, a consumer might only care about works authored by an Organization, not by a Person.
Providing the name property can be useful for consumers that display the included structured data in some way that benefits from a name/label.
I'm new with Schema.org markup, so I've actually come up with the following codes for my real estate markup, and Google testing keep saying I shouldn't use offer for priceSpecification. I'm so lost now.
{
"#context": "http://schema.org/",
"#type": "Product",
"name": "Nodorus - Precinct 17",
"image": "http://www.setiaalam.com.my/images/products/p17/nodorus-c.jpg",
"description": "A distinct modern link residence set amidst award-winning green spans, wetland wonders and multiple amenities. Come home to articulately crafted spaces where architecture and nature's beauty infuse home with fresh chic. Rejoice in this cosy new addition to Setia Alam North.",
"additionalType": "Product",
"Offer": {
"#type": "PriceSpecification",
"priceCurrency": "RM",
"priceSpecification": {
"minPrice": "593000",
"maxPrice": "890000"
},
"availability": "http://schema.org/InStock",
"seller": {
"#type": "Organization",
"name": "S P Setia"
}
}
}
If you want to add an Offer for a Product, you have to use the offers property.
So instead of this (which doesn’t make sense, because Offer is not a property):
{
"#context": "http://schema.org/",
"#type": "Product",
"Offer": {}
}
You have to use this:
{
"#context": "http://schema.org/",
"#type": "Product",
"offers": {}
}
The type of the offers value should be Offer, not PriceSpecification.
The PriceSpecification can be added to the Offer via the priceSpecification property.
So the structure could look like:
{
"#context": "http://schema.org/",
"#type": "Product",
"offers": {
"#type": "Offer",
"priceSpecification": {
"#type": "PriceSpecification"
}
}
}