Questions tagged [blank-nodes]

Blank nodes are a kind of RDF terms, along with IRIs and literals. The resource represented by a blank node is also called an anonymous resource.

Important quotes from related specifications

From RDF 1.1 Concepts and Abstract Syntax:

Blank node identifiers are local identifiers that are used in some concrete RDF syntaxes or RDF store implementations. They are always locally scoped to the file or RDF store, and are not persistent or portable identifiers for blank nodes.

From RDF 1.1 Semantics:

RDF graphs can be viewed as conjunctions of simple atomic sentences in first-order logic, where blank nodes are free variables which are understood to be existential. Taking the union of two graphs is then analogous to syntactic conjunction in this syntax. RDF syntax has no explicit variable-binding quantifiers, so the truth conditions for any RDF graph treat the free variables in that graph as existentially quantified in that graph. Taking the union of graphs which share a blank node changes the implied quantifier scopes.

From SPARQL 1.1 Query Language:

Blank node labels are scoped to a result set.

There need not be any relation between a label _:a in the result set and a blank node in the data graph with the same label.

An application writer should not expect blank node labels in a query to refer to a particular blank node in the data.

From SPARQL 1.1 Update:

Blank nodes... are assumed to be disjoint from the blank nodes in the Graph Store, i.e., will be inserted with "fresh" blank nodes.

Some discussion

Different triplestores provides solutions for the "problems" described.
E.g., Jena allows to use pseudo-URIs like <_:b1> etc.

80 questions
16
votes
2 answers

The difference between blank nodes and variables in SPARQL queries

I've studied SPARQL specification on the topic and also found this answer rather interesting. However definitions are complicated enough, so I still don't see the answer for my question. I can't find any example of query with blank nodes that…
Andy White
  • 163
  • 1
  • 5
12
votes
3 answers

How to recursively expand blank nodes in SPARQL construct query?

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…
rogueleaderr
  • 4,084
  • 2
  • 28
  • 40
10
votes
1 answer

Is there a syntax to define cyclic reference between anonymous nodes in Turtle RDF?

I'm looking for a turtle syntax for calling the anonymous node who call an other anonymous node. For example, I want to reproduce this code : :Instance0 a Class0; :property0 :Instance1. :Instance1 a Class1; :property1…
7
votes
1 answer

Excluding Blank Nodes from SPARQL query results

I am using RDFLib to query on the Semantic Dicom Ontology. I am querying for owl:Class in the graph constructed from the above ontology. RDFLib returns results which contain blank nodes and I wish to exclude such queries. My query - from rdflib…
Anmol Kagrecha
  • 137
  • 2
  • 8
7
votes
1 answer

Sparql query with Blank node can be complex

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…
Competo
  • 123
  • 1
  • 10
6
votes
1 answer

How to get a concise bounded description of a resource with Sesame?

I've been testing Sesame 2.7.2 and I got a big surprise when faced to the fact that DESCRIBE queries do not include blank nodes closure [EDIT: the right term for this is CBD for concise bounded description] If I correctly understand, the SPARQL spec…
Max
  • 675
  • 4
  • 14
5
votes
3 answers

JSON-LD blank node to nested object in Apache Jena

I have the following example Turtle document: @prefix dct: . @prefix rdf: . @prefix example: . @prefix dcat: …
linsenfips
  • 668
  • 6
  • 25
5
votes
1 answer

Controlling conversion of RDF to "prettier" JSON-LD

I'm aware that conversion of RDF to JSON-LD has some limitations, but I wonder if there is a good way of making the conversion avoid use of blank nodes? For example, given an RDF graph: @prefix ex:
brinxmat
  • 1,151
  • 1
  • 10
  • 13
5
votes
2 answers

Ensure that multiple subjects point to same list of blank nodes

Consider the following instance of SomeClass: instances:some_thing1 a semapi:SomeClass ; semapi:hasChainTo ( [ ... ] [ ... ] [ ... ] ) . I need every instance (some_thing2,…
parliament
  • 18,013
  • 35
  • 131
  • 223
4
votes
1 answer

The DELETE/INSERT operation can be used to remove triples containing blank nodes: how?

I would like to use a SPARQL DELETE/INSERT to ensure that after repeated updates ?performance and certain connected blank nodes do not have multiple property values but only zero (for optional cases) or one (for mandatory cases). If I send the…
Drux
  • 10,334
  • 10
  • 58
  • 107
4
votes
1 answer

Jena delete a triple with an anonymous node

I have been trying to delete a triple from a model using Jena with no success. Things work well when the subject, predicate and object are URIs or literals, but for anonymous nodes it doesn't seem to work. For example, consider this triple in a…
Veni_Vidi_Vici
  • 291
  • 1
  • 6
  • 15
4
votes
1 answer

Is there a way to use a variable without returning it with SPARQL "select *"?

Is there some way to use a kind of placeholder variable with SPARQL without returning it when using SELECT * ? For example: SELECT * WHERE { ?s dcterms:title ?title; foaf:person ?name. ?s2 :inProject ?s. } Where I would not want to…
Nick Bartlett
  • 4,315
  • 1
  • 20
  • 37
3
votes
2 answers

Is RDF graph lean or not lean?

I just discovered the definition of a lean graph and I don't always know how to define it and if someone can explain to me if this graphs are lean or not . G1 : _:X foaf:knows ex:bob _:X foaf:knows _:Y I think this is lean ! G2: _:X…
Midoki
  • 78
  • 8
3
votes
1 answer

Import RDF: are referenced blank nodes gonna be merged or handled separately?

When importing RDF into a triple store: Are referenced blank nodes (as object) gonna be merged or handled separately, as if they are distinct? Example RDF to import into a triple store: @prefix ex: . ex:foo ex:bar [ ex:baz 42 ], [ …
k00ni
  • 135
  • 13
3
votes
2 answers

Can a Blank Node have rdf:type property?

Is it valid to form the following triple: _:bn rdf:type foaf:name where _:bn is a blank node? I read the W3C standards for rdf:type. It says that the rdfs:domain of rdf:type is rdfs:resource. rdfs:resource is the the class of everything. So is it…
Anmol Kagrecha
  • 137
  • 2
  • 8
1
2 3 4 5 6