blank-nodes

Sparql query with Blank node can be complex

痞子三分冷 提交于 2019-12-04 06:10:58
I read this blog article, Problems of the RDF model: Blank Nodes , and there's mentioned that using blank nodes can complicate the handling of data. Can you give me an example why using blank nodes is difficult to perform a SPARQL query? I do not understand the complexity of blank nodes. Can you explain me the meaning and semantics of an existential variable? I do not understand clearly this explanation given in the RDF Semantics Recommendation, 1.5. Blank Nodes as Existential Variables . Joshua Taylor Existential Variables In the (first-order) predicate calculus, there is existential

How to recursively expand blank nodes in SPARQL construct query?

戏子无情 提交于 2019-12-04 01:16:52
There is probably an easy to answer to this, but I can't even figure out how to formulate the Google query to find it. I'm writing SPARQL construct queries against a dataset that includes blank nodes. So if I do a query like CONSTRUCT {?x ?y ?z .} WHERE {?x ?y ?z .} Then one of my results might be: nm:John nm:owns _:Node Which is a problem if all of the _:Node nm:has nm:Hats triples don't also get into the query result somehow (because some parsers I'm using like rdflib for Python really don't like dangling bnodes). Is there a way to write my original CONSTRUCT query to recursively add all

Adding blank nodes to a Jena model

ε祈祈猫儿з 提交于 2019-12-02 14:56:52
问题 I'm trying to populate a Jena ontology model with an existing set of triples, some of which contain blank nodes. I want to maintain these blank nodes inside this new model faithfully but I can't work out a way of adding them into a Jena model. I have been using: Statement s = ResourceFactory.createStatement(subject, predicate, object); To add new statements to the model: private OntModel model = ModelFactory.createOntologyModel(); model.add(s); but this only allows for certain types as

JSON-LD blank node to nested object in Apache Jena

六眼飞鱼酱① 提交于 2019-12-01 20:49:39
I have the following example Turtle document: @prefix dct: <http://purl.org/dc/terms/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix example: <http://example.com/vocabulary/> . @prefix dcat: <http://www.w3.org/ns/dcat#> . <http://example.com/datasets/1> a dcat:Distribution ; example:props [ example:prop1 "hello" ; example:prop2 "1" ] ; dct:description "test data" . I converted it into JSON-LD with the Apache Jena (RDFDataMgr with JSONLD_COMPACT_PRETTY) to JSON-LD: { "@context": { "dct": "http://purl.org/dc/terms/", "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",