Starting in ThingIn version 2.8.0, blank nodes are supported in INPUT, for the following formats:
In OUTPUT, all formats support blank nodes, using a statically generated IRI generated is the form of an uuid preceded by an underscore.
For the remaining formats (turtle, JSON...), blank nodes are currently NOT supported.
For the supported formats, blank nodes must be declared within a named graph, see Named Graphs. Some examples below dettail how to declare blank nodes.
@prefix ns1: <http://www.opengis.net/ont/geosparql#> .
@prefix ns2: <http://xmlns.com/foaf/0.1/> .
<http://www.example.com/blanknodes1/> {
[] a <http://www.disit.org/km4city/schema#Postal_office> ;
ns2:knows [ ns1:asWKT "\"Point(6.5734335504781924 46.522478338309504)\"^^<http://www.opengis.net/ont/geosparql#wktLiteral>" ] .
}
<http://www.example.com/blanknodes2/> {
[] a <http://www.disit.org/km4city/schema#Postal_office> ;
ns2:knows [ ns1:asWKT "\"Point(6.5734335504781924 46.522478338309504)\"^^<http://www.opengis.net/ont/geosparql#wktLiteral>" ] .
}
This graph declared 4 blank nodes, in two different named graphs http://www.example.com/blanknodes1/
and http://www.example.com/blanknodes2/
, which will correspond to two different domains.
Since the equivalent of named graph in ThingIn is a domain, blank nodes can only be part of one domain. The first named graph declared is thus picked as the corresponding domain of a blank node. Consider the example graph in TriG format below:
@prefix ns2: <http://xmlns.com/foaf/0.1/> .
<http://www.example.com/blanknodes1/> {
_:p1 a foaf:Person .
}
<http://www.example.com/blanknodes2/> {
[] a foaf:Person ;
ns2:knows _:p1 .
}
This graph declared 2 blank nodes, of which _:p1
is declared in two seperate named graphs http://www.example.com/blanknodes2/
and http://www.example.com/blanknodes2/
. Since it was first declared in http://www.example.com/blanknodes1/
, it will belong to this domain. Like regular avatars, links between domain are authorized.
Finally, consider this example:
@prefix ns2: <http://xmlns.com/foaf/0.1/> .
<http://www.example.com/blanknodes1/> {
_:p1 a foaf:Person ;
ns2:knows _:p2 .
}
<http://www.example.com/blanknodes2/> {
_:p2 a foaf:Person .
}
This graph declared also declares 2 blank nodes. However _:p2
is declared in the first as an object property object but not as a subject of a statement in the named graph http://www.example.com/blanknodes1/
. In that case, it is considered to belong to the second named graph http://www.example.com/blanknodes2/
.
For JSON-LD, the same rules above apply. The @graph
notation must be used to declare the named graph:
[
{
"@id": "http://www.example.com/blanknodes3/",
"@graph": [
{
"@type": [
"http://www.disit.org/km4city/schema#Postal_office"
],
"http://xmlns.com/foaf/0.1/knows": {
"@id": "_:b"
}
},
{
"@id": "_:b",
"@type": [
"http://www.disit.org/km4city/schema#Postal_office"
]
}
]
}
]
Future work:
Rdf-star equivalents of the supported formats, such as TriG-star, are expected to support blank nodes when they are supported and a future release.