Giter VIP home page Giter VIP logo

Comments (9)

jason-fox avatar jason-fox commented on August 16, 2024 1

The problem only lies in your use of JSON-LD, where in the context you use a label that is mistaken for a relative URI.

OK, so it's the key that is the issue, not the value.

from data-models.

albertoabellagarcia avatar albertoabellagarcia commented on August 16, 2024

Is the problem URIs of the type 'https://uri.fiware.org? (It really takes you nowhere)

from data-models.

pietercolpaert avatar pietercolpaert commented on August 16, 2024

No, that would be good thing to fix, but it’s not the cause of this bug that breaks the use of the Smart Data Models in any Linked Data client. The root cause is the default fiware context is invalid JSON-LD due to a property that is interpreted as a relative URI is being mapped to another URI.

Please check the validity of your LD documents before any commit.

You can use the npm library json-ld or rdf-parse for that (if you also want to support other RDF serializations).

Test it yourself from the browser here: https://rdf-play.rubensworks.net/#url=https%3A%2F%2Fsmart-data-models.github.io%2FdataModel.Transportation%2FBikeHireDockingStation%2Fexamples%2Fexample.jsonld&proxy=https%3A%2F%2Fproxy.linkeddatafragments.org%2F

from data-models.

albertoabellagarcia avatar albertoabellagarcia commented on August 16, 2024

I guess you mean that extended terms cannot be a relative location into another file like most, if not all, of the terms in the context?
so instead of having
https://uri.fiware.org/ns/data-models#StreetlightModel
it should be i.e.
https://uri.fiware.org/ns/data-models/StreetlightModel
am I right?

from data-models.

pietercolpaert avatar pietercolpaert commented on August 16, 2024

Not at all. It is exactly what the error says and I don’t know how to explain this otherwise than: you don’t have valid JSON-LD due to using what JSON-LD udnerstands as a relative IRI in a property.

Screenshot ↓
Screenshot from 2020-12-22 15-51-37

from data-models.

jason-fox avatar jason-fox commented on August 16, 2024
  • https://uri.fiware.org/ns/data-models#xxx is fine ✅
  • https://uri.fiware.org/ns/data-models#xxx/yyy is not. ❌
  • https://uri.fiware.org/ns/data-models/xxx is fine ✅
  • https://uri.fiware.org/ns/data-models/xxx/yyyis a bit weird but is also legal. ✅

Best to stick to one element at the end so you can create the @context as shown:

{
    "@context": {
        "type": "@type",
        "id": "@id",
        "fiware": "https://uri.fiware.org/ns/data-models#",
        "Building": "fiware:Building",
        "Device": "fiware:Device",
        ... etc
}

from data-models.

pietercolpaert avatar pietercolpaert commented on August 16, 2024
  • https://uri.fiware.org/ns/data-models#xxx/yyy is not. x

No, this is also a valid URI (RFC3986). The problem only lies in your use of JSON-LD, where in the context you use a label that is mistaken for a relative URI.

from data-models.

albertoabellagarcia avatar albertoabellagarcia commented on August 16, 2024

I guess there were four keys (all of them coming from the old context). @pietercolpaert could check it again?

from data-models.

pietercolpaert avatar pietercolpaert commented on August 16, 2024

Houray! It works now indeed!

Unrelated to this issue (which I’ll close now) is that the Linked Data itself from these examples contain quite some issues and if you want to call this NGSI-LD it would be nice if this would be given a bit more love so that Linked Data agents can actual query across these subject pages :) Check for example https://rdf-play.rubensworks.net/#url=https%3A%2F%2Fsmart-data-models.github.io%2FdataModel.Transportation%2FBikeHireDockingStation%2Fexamples%2Fexample.jsonld&proxy=https%3A%2F%2Fproxy.linkeddatafragments.org%2F

from data-models.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.