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
2
votes
1 answer

How does rdf reification work when the object is a bNode?

RDF reification is pretty straightforward as long as subject, predicate and object are IRIs (or the object a literal). But what does the rdf:Statement look like when the object is a blank node (bNode)? An example ("I saw a man in a dirty…
LarsG
  • 33
  • 1
  • 6
2
votes
1 answer

Produce the same blank node in CONSTRUCT across multiple solutions

I've come across several occasions where I've wanted to use blank nodes in a CONSTRUCT query, but I've needed to get the same blank node for all (or several) query solutions. Let's say that we have in our dataset a list of authors and books they…
2
votes
2 answers

Traversing anonymous/blank nodes in Jena

I am using Apache Jena's API, where a graph contains some anonymous/blank nodes as well, due to unionOf and intersectionOf. One of such example is:
Pratik
  • 908
  • 2
  • 11
  • 34
2
votes
1 answer

Adding blank nodes to a Jena model

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…
2
votes
1 answer

retrieving a blank node used as a type

I have an ontology something like: :indi_1 a :Segment; a [ :builds only {:indi_2}]; :hasID 1. Now I want to find the individual(s) which indi_1 builds. I made the following query: SELECT distinct ?a WHERE {:indi_1 a ?b. ?b a _:blankNode} but I…
msc87
  • 943
  • 3
  • 17
  • 39
2
votes
1 answer

What are values starting with "t" and how to ignore them for counting

I am trying to query the frequency of certain attributes in Wikidata, using SPARQL. For example, to find out what the frequency of different values for gender is, I have the following query: SELECT ?rid (COUNT(?rid) AS ?count) WHERE { ?qid wdt:P21…
benroth
  • 2,468
  • 3
  • 24
  • 25
2
votes
1 answer

Delete blank node from ontology through SPARQL UPDATE

I am storing some data in my ontology model made in protege with help of a SPARQL UPDATE 'insert' operation. Below is the update query. PREFIX test: insert { []…
Usman Khan
  • 147
  • 15
2
votes
1 answer

Adding triple containing blank node to Stardog with RDFLib

I'm using the RDFLib Python library to manipulate a Stardog database. How do I add a blank node? I'm trying g.add((BNode(),FOAF.knows,Literal('amy'))), but I get an exception "SPARQLStore does not support Bnodes!". What is the alternative?
2
votes
1 answer

Create Individuals inside of Jena Rules

I have an ontology with a lot of individuals and use the Jena reasoner to get information about them. My goal is to create new individuals based on the given information inside of that rules and assign properties to them. The individuals don't have…
ImmaCute
  • 57
  • 7
2
votes
1 answer

How to retrieve blank nodes from DBpedia in SPARQL, and explaining reduced results with DISTINCT

I want to retrieve blank nodes with a SPARQL query. I am using DBpedia as my dataset. For example, when I use the following query, I got a count of about 3.4 million results. PREFIX prop: select count(?x) where { ?x…
Amar
  • 755
  • 2
  • 16
  • 36
2
votes
1 answer

How to assign parameter values in a SparqlParameterizedString

I'm playing around some with Dotnetrdf's sparql engine and I'm trying to create parametered queries with no success yet. Say I'm working on a graph g with a blank node identified as _:1690 with the code Dim queryString As SparqlParameterizedString =…
Max
  • 685
  • 4
  • 14
1
vote
0 answers

SPARQL Join based on blank RDF nodes

Please excuse the (possible) triviality of the question. I want to confirm that my understanding of the SPARQL specification is correct. I imagine joining in SPARQL based on blank RDF nodes works just fine, i.e., when the join variable(s) of two…
Median Hilal
  • 1,483
  • 9
  • 17
1
vote
0 answers

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

Fuseki returns this from my DESCRIBE query: { "@graph": [ { "@id": "ex:LE-propertyShape", "sh:or": { "@list": [ { "@id": "_:b3" }, { "@id": "_:b1" } ] …
agustaf
  • 683
  • 1
  • 6
  • 19
1
vote
1 answer

RDF/XML Representing address with blank nodes

I am new to RDF/XML notation and I am having trouble with addresses. I tried to google for examples but I can't find any; all I find are graphical notations, which isn't in the format I need. This is an example of what I want to achieve. This is…
1
vote
0 answers

Issue when updating triple with blank nodes using sqarql

This is my query, this query works fine for nodes with no blank node but the issue with arrives while updating with blank node here those nodes get repeated 100 times after updating DELETE { it:4D9AT21jAasfL9ah schema:description ?o_0 . …
Rwz Stha
  • 11
  • 1
  • 3