json-ld / json-ld.org

JSON for Linked Data's documentation and playground site
https://json-ld.org/
Other
853 stars 152 forks source link

@id is numeric with @base : not processed by several JSON-LD engines: is it legal? #742

Open jmvanel opened 3 years ago

jmvanel commented 3 years ago

"taxonKey" is an @id and it is numeric. It is associated with a @base. json

{
  "gbifID":"1258202889",
  "protocol": "DWC_ARCHIVE",
  "basisOfRecord": "PRESERVED_SPECIMEN",
  "taxonKey": 7310533
}

jsonld @context

{ "@context": {
  "@vocab" : "http://rs.tdwg.org/dwc/terms/",
  "@base" : "https://api.gbif.org/v1/occurrence/",

  "dwciri": "http://rs.tdwg.org/dwc/iri/",
  "gbifID": "@id",
  "taxonKey":{
    "@context": {
      "@base" : "https://api.gbif.org/v1/species/"
    },
    "@id": "dwciri:toTaxon", "@type": "@id"
  }
} }

Expected:

<https://api.gbif.org/v1/occurrence/1258202889>
        <http://rs.tdwg.org/dwc/iri/toTaxon>
                <https://api.gbif.org/v1/species/7310533> .

Current output

<https://api.gbif.org/v1/occurrence/1258202889>
        <http://rs.tdwg.org/dwc/iri/toTaxon>
                7310533 .

If numeric @id's are legal, it should be mentioned the specification, no ? There is a problem with round tripping back to JSON here, but in my use case I only care about getting RDF triples.