Ok, I got it:

{
  "@context": {"@vocab": "http://ao.com/"},
  "@id" : "http://ao.com/uc/example";,
  "propOf": {
    "property": {
        "term" : [
            "w0",
            "w1"
        ]
    },
    "object": "w2"
  }
}

Now, this is a valid example. I can read it with SPARQL SELECT.

So, back to the original question: 

How do I get the whole structure at once – not flattened as an array of 
bindings? Basically, I want to have output similar to the input above …


Stefan


On 4/24/17, 3:23 PM, "Dimov, Stefan" <[email protected]> wrote:

    Thanks, Andy,
    
    When I add a @context:
    
      "@context": "http://example.org/";,
      "@graph": [{
        "@id": "http://example.org/library";,
        "@type": "Library",
        "contains": {
          "@id": "http://example.org/library/the-republic";,
          "@type": "Book",
          "contains": {
            "@id": "http://example.org/library/the-republic#introduction";,
            "@type": "Chapter",
            "description": "An introductory chapter on The Republic.",
            "title": "The Introduction"
          },
          "creator": "Plato",
          "title": "The Republic"
        }
      }]
    }
    
    and load the graph, the framework tries to contact http://example.org/.
    
    Can I avoid that?
    
    Stefan
    
    
    
    On 4/24/17, 2:30 PM, "Andy Seaborne" <[email protected]> wrote:
    
        Stefan,
        
        Try the data at
        
        http://json-ld.org/playground/
        
        Without a @context, I don't think you'll get many triples.
        
             Andy
        
        
        On 24/04/17 22:09, Dimov, Stefan wrote:
        > Hi,
        >
        > I’m experimenting with JSON-LD and I have this in a named graph:
        >
        > {
        >   "@graph": [{
        >     "@id": "http://example.org/library";,
        >     "@type": "Library",
                        ^^^^^^^^ relative URI.
        
        >     "contains": {
        >       "@id": "http://example.org/library/the-republic";,
        >       "@type": "Book",
        >       "contains": {
        >         "@id": "http://example.org/library/the-republic#introduction";,
        >         "@type": "Chapter",
        >         "description": "An introductory chapter on The Republic.",
        >         "title": "The Introduction"
        >       },
        >       "creator": "Plato",
        >       "title": "The Republic"
        >     }
        >   }]
        > }
        >
        > What should be the SPARQL request that will return me the whole 
object by id “http://example.org/library” ?
        >
        > Stefan
        >
        
    
    

Reply via email to