How can I nest my list of blank nodes rather than have each one in a different graph

49 Views Asked by At

Fuseki returns this from my DESCRIBE query:

{
  "@graph": [
    {
      "@id": "ex:LE-propertyShape",
      "sh:or": {
        "@list": [
          {
            "@id": "_:b3"
          },
          {
            "@id": "_:b1"
          }
        ]
      },
      "@type": "sh:PropertyShape"
    },
    {
      "@id": "_:b1",
      "sh:class": {
        "@id": "ex:Person"
      }
    },
    {
      "@id": "_:b3",
      "sh:class": {
        "@id": "ex:User"
      }
    }
  ],
  "@context": {
    "ex": "https://example.com/ontologies/ex#",
    "sh": "http://www.w3.org/ns/shacl#"
     }
}

How can I get the format to look like this:

{
      "@id": "ex:LE-propertyShape",
      "sh:or": {
        "@list": [
          {
            "sh:class": "ex:User"
          },
          {
            "sh:class": "ex:Person"
          }
        ]
      },
      "@type": "sh:PropertyShape",
      "@context": {
          "ex": "https://example.com/ontologies/ex#",
          "sh": "http://www.w3.org/ns/shacl#"
       }
}

Putting the desired result into https://issemantic.net/rdf-converter and converting to trig results in a set of valid triples, implying that this format is valid, but when using the same converter to go from trig back to jsonld, it gets converted back to the first example.

0

There are 0 best solutions below