This plugin was developed as a way to efficiently work with with Concise Bounded Descriptions in SPARQL. It defines a property function that returns all blank nodes 'nested' under a resource.
Given a particular node (the starting node) in a particular RDF graph (the source graph), a subgraph of that particular graph, taken to comprise a concise bounded description of the resource denoted by the starting node, can be identified as follows:
- Include in the subgraph all statements in the source graph where the subject of the statement is the starting node;
- Recursively, for all statements identified in the subgraph thus far having a blank node object, include in the subgraph all statements in the source graph where the subject of the statement is the blank node in question and which are not already included in the subgraph.
- Recursively, for all statements included in the subgraph thus far, for all reifications of each statement in the source graph, include the concise bounded description beginning from the rdf:Statement node of each reification.
This results in a subgraph where the object nodes are either URI references, literals, or blank nodes not serving as the subject of any statement in the graph.
The second item in the definition is what this plugin helps with: recursively retrieving all blank nodes. This is something that is difficult in SPARQL to do for arbitrary depth trees (cycles in blank nodes should be avoided, and will result in a warning).
Build the jar:
mvn package
Copy the resulting package to the 'lib' folder of your Jena installation.
Alternatively, use make to download Jena and build the project.
See test/test-query.rq.