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:
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.summyUrl.com/something#Entity1"/>
<rdf:Description rdf:about="http://www.summyUrl.com/something#Entity2"/>
</owl:unionOf>
</owl:Class>
which is an anonymous node/resource. When I try to get its URI, it is something like:
"-50a5734d:15d839467d9:-1b8b"
I am neither able to do SPARQL query using such URIs (due to exception on parsing such URIs), nor able to find appropriate Jena method to handle it.
I am looking for a way to explode such nodes and get all the nested resources of it.
For example in below case, it should return <http:/.../Entity1>
, <http:/.../Entity2>
and <http:/.../Entity3>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.summyUrl.com/something#Entity1"/>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://www.summyUrl.com/something#Entity2"/>
<rdf:Description rdf:about="http://www.summyUrl.com/something#Entity3"/>
</owl:unionOf>
</owl:unionOf>
</owl:Class>
Is there any inbuilt method of Jena to handle it?
If not, how can I do it efficiently?