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.

89 questions
3
votes
2 answers

How to know if an RDF graph is 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…
Mouad
  • 115
  • 1
  • 10
3
votes
1 answer

How to filter by BlankNode id

I'm trying to run this query in the SPARQL playground on GraphDB. select * where { ?s content:value ?value . FILTER REGEX(str(?value), "_:x1697BD364N0abcdd866d54") } ?value are BNodes I'm trying to filter all values where the BNode ID is:…
ueeieiie
  • 1,412
  • 2
  • 15
  • 42
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
  • 315
  • 4
  • 17
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
  • 153
  • 2
  • 10
3
votes
1 answer

Grouping by blank nodes

I have the following data: @prefix f: . _:a f:trait "Rude"@en . _:a f:name "John" . _:a f:surname "Roy" . _:b f:trait "Crude"@en . _:b f:name "Mary" . _:b f:surname "Lestern" . However, if I execute the following query in…
Gitnik
  • 564
  • 7
  • 26
3
votes
1 answer

What is the proper universal way of inserting blank nodes using SPARQL

I am writing an application using the Apache Jena framework. With this I am able to do everything (insert, update, select). But i can't wrap my head around how to properly insert blank nodes using an INSERT query. Is there a go-to approach for this…
oole
  • 342
  • 3
  • 13
3
votes
1 answer

Solutions for BNode in Sesame

Is there any solution for processing BNODE in Sesame? for example: if(! (statement.getObject() instanceof BNode)) tempModel.remove(statement); if we have an RDF like { s p1 _:a, _:a p2 "value"), therefore even after removing the…
jd466
  • 547
  • 1
  • 6
  • 20
3
votes
1 answer

SPARQL: Selecting the nth blanknode

Take the following graph: :Foo :p _:b0 ; :p _:b1 ; :p _:b2 . _:b0 :p1 :apple ; :p2 :banana . _:b1 :p3 :cantaloupe ; :p4 :date ; :p5 :elderberry . _:b2 :p6 :fig . Notice: :Foo is the subject of three triples with the same…
Blake Regalia
  • 2,677
  • 2
  • 20
  • 29
3
votes
1 answer

JSON-LD @id with IRI results in blank node

I have a small JSON file hosted on a local web server with the following content: json_source = {"key1": "azerty", "key2": "qwerty", "key3": "lorem", "key4": "ipsum"} Using the RDFLib library, I'm parsing the JSON, adding some semantics using the…
Brainlock
  • 243
  • 4
  • 11
3
votes
1 answer

Map blank nodes from stardog to pubby

So I have this .rdf that I have loaded onto Stardog and then I am using Pubby running over Jetty, to browse the triple store. In my rdf file, I have several blank nodes which is given a blank node identifier by stardog. So this is a snippet of the…
Abhay
  • 235
  • 1
  • 3
  • 8
2
votes
0 answers

Is it possible to convert some IRIs to blank nodes in SPARQL?

Given the following Turtle: prefix : prefix blank: prefix rdf: :alice :friends blank:b1 . blank:b1 rdf:first "Alice" ; rdf:rest …
Labra
  • 1,412
  • 1
  • 13
  • 33
2
votes
2 answers

Adding blank nodes in triples

The code written below gives the following output: Code: person =…
2
votes
1 answer

JSON-LD: Assign custom URIs to blank nodes within context

I'm trying to convert a very large JSON file to JSON-LD. When I import the example code below into GraphDB, db:metadata becomes a property/predicate connecting each GeneSet:setX node with an automatically created blank node _:bX (gray in figure),…
gaspanic
  • 249
  • 1
  • 12
2
votes
1 answer

How to get XML Attributes via rdflib

I have an rdf file with the following content:
Lukas Schmid
  • 1,895
  • 1
  • 6
  • 18
2
votes
0 answers

Identity of blank nodes

I am well aware of the way blank nodes are used, that they represent a locally-declared node with no IRI given. However, I am not sure how to interpret an actual logical "meaning" of a blank node. Does it have an identity? Is it different from any…
IS4
  • 11,945
  • 2
  • 47
  • 86