Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngsi-ld #9

Open
gezever opened this issue Apr 27, 2021 · 2 comments
Open

ngsi-ld #9

gezever opened this issue Apr 27, 2021 · 2 comments

Comments

@gezever
Copy link

gezever commented Apr 27, 2021

Hello,
I tried to transform the piece of ngsi-ld, presented in the workshop, to another type of rdf. I used jena riot, but there was an error.
tmp$ /opt/apache-jena-3.14.0/bin/riot --output=TURTLE test.json
15:00:47 ERROR riot :: [line: 2, col: 11] Expected BNode or IRI: Got: [STRING:urn:ngsi-ld:AirQualityObserved:RZ:Obsv4567]

My question is now: is this file realy rdf or is my software not compatible yet? (since we use apache jena in java for production backend code)

tmp$ cat test.json
{
"id": "urn:ngsi-ld:AirQualityObserved:RZ:Obsv4567",
"type": "AirQualityObserved",
"dateObserved": {
"type": "Property",
"value": {
"@type": "DateTime",
"@value": "2018-08-07T12:00:00Z"
}
},
"NO2": {
"type": "Property",
"value": 22,
"unitCode": "GP"
},
"refPointOfInterest": {
"type": "Relationship",
"object": "urn:ngsi-ld:PointOfInterest:RZ:MainSquare"
},
"@context": [
"https://schema.lab.fiware.org/ld/context",
"https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
]
}

Kind regards

@bertvannuffelen
Copy link
Contributor

It seems that "https://schema.lab.fiware.org/ld/context" has not enabled CORS.
When removing that the json-ld playground returns triples.

<urn:ngsi-ld:AirQualityObserved:RZ:Obsv4567> <https://uri.etsi.org/ngsi-ld/default-context/NO2> _:b0 .
<urn:ngsi-ld:AirQualityObserved:RZ:Obsv4567> <https://uri.etsi.org/ngsi-ld/default-context/dateObserved> _:b1 .
<urn:ngsi-ld:AirQualityObserved:RZ:Obsv4567> <https://uri.etsi.org/ngsi-ld/default-context/refPointOfInterest> _:b2 .
_:b0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://uri.etsi.org/ngsi-ld/Property> .
_:b0 <https://uri.etsi.org/ngsi-ld/hasValue> "22"^^<http://www.w3.org/2001/XMLSchema#integer> .
_:b0 <https://uri.etsi.org/ngsi-ld/unitCode> "GP" .
_:b1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://uri.etsi.org/ngsi-ld/Property> .
_:b1 <https://uri.etsi.org/ngsi-ld/hasValue> "2018-08-07T12:00:00Z"^^<https://uri.etsi.org/ngsi-ld/DateTime> .
_:b2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://uri.etsi.org/ngsi-ld/Relationship> .
_:b2 <https://uri.etsi.org/ngsi-ld/hasObject> <urn:ngsi-ld:PointOfInterest:RZ:MainSquare> .

So I think you hit a json-ld bug in riot. Or the Firware context contains additional transformations which are not spotted by this simple test.

@flopezag
Copy link

I suggest to use the context: https://smartdatamodels.org/context.jsonld

We made the migration of the previous context to this new one and we resolved some issues regarding JSON-LD format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants