Code Monkey home page Code Monkey logo

Comments (5)

ashleysommer avatar ashleysommer commented on June 1, 2024

Hi @RinkeHoekstra
Thanks for the report.

Better handling of named graphs is actually something I've been wanting to address in pySHACL for some time. There are some named-graph-specific niche features of the SHACL spec that aren't implemented simply because we don't currently handle named graphs well.

To he honest, I didn't know it is possible for JSON-LD files to contain multiple named graphs. I've personally never come across a JSON-LD file with multiple graphs. Are you able to please attach or link to an example of a JSON-LD file that exhibits this described behavior?

You're right, the best solution is to load all named graphs into a Dataset, then validate each graph individually and potentially produce a separate validation report for each named graph too.

from pyshacl.

RinkeHoekstra avatar RinkeHoekstra commented on June 1, 2024

Hi @ashleysommer,

I actually use it quite a lot. Here's an example from the JSON-LD spec:

{
  "@context": {
    "generatedAt": {
      "@id": "http://www.w3.org/ns/prov#generatedAtTime",
      "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
    },
    "Person": "http://xmlns.com/foaf/0.1/Person",
    "name": "http://xmlns.com/foaf/0.1/name",
    "knows": {"@id": "http://xmlns.com/foaf/0.1/knows", "@type": "@id"}
  },
  "@id": "http://example.org/foaf-graph",
  "generatedAt": "2012-04-09T00:00:00",
  "@graph": [
    {
      "@id": "http://manu.sporny.org/about#manu",
      "@type": "Person",
      "name": "Manu Sporny",
      "knows": "https://greggkellogg.net/foaf#me"
    }, {
      "@id": "https://greggkellogg.net/foaf#me",
      "@type": "Person",
      "name": "Gregg Kellogg",
      "knows": "http://manu.sporny.org/about#manu"
    }
  ]
}

And in TriG:

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://example.org/foaf-graph> prov:generatedAtTime "2012-04-09T00:00:00"^^xsd:dateTime .

<http://example.org/foaf-graph> {
  <http://manu.sporny.org/about#manu> a foaf:Person;
     foaf:name "Manu Sporny";
     foaf:knows <https://greggkellogg.net/foaf#me> .

  <https://greggkellogg.net/foaf#me> a foaf:Person;
     foaf:name "Gregg Kellogg";
     foaf:knows <http://manu.sporny.org/about#manu> .
}

from pyshacl.

ashleysommer avatar ashleysommer commented on June 1, 2024

Hi @RinkeHoekstra
Just FYI, I've started work on this feature now. It will be full-support like suggestion 3 in initial post.

from pyshacl.

ashleysommer avatar ashleysommer commented on June 1, 2024

Hi @RinkeHoekstra
Good news. The latest version of pySHACL (v0.11.0) has support to what we've discussed above.
If the feature is still applicable to your use-case, can you please test it to ensure it does what is expected.

Fixed via 034b213

from pyshacl.

RinkeHoekstra avatar RinkeHoekstra commented on June 1, 2024

from pyshacl.

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.