Blank nodes in RDF


Are blank nodes still being labeled as BNode after imported? I imported the STATO ontology using
CALL semantics.importRDF(‘’, ‘RDF/XML’).
But no node seems to be labeled as BNode. There’re many blank nodes because of owl:restriction. What’s intersting is there’re also blank nodes of type owl:Class (labled as owl__Class after import).

I’m asking because I want to find a way to exclude the blank nodes in a search. Right now I’m using

MATCH (n:owl__Class) where exists(n.rdfs__label) RETURN n

But I think there must be a better way to do this.

Thank you!


Hi Dazhi, welcome to the community!
Blank nodes are not labelled as BNode anymore. That was removed quite a while ago because it created write overhead and did not add much value.

Yes, as you say, restrictions are effectively anonymous class declarations. Actually, you will have an anonymous (blank node) class whenever the class is defined as either a property restriction, as an enumeration or as a union/intersection/complement.

Here is an example in the ontology you're loading:

Given that, one way to get all non blank node classes could be using the uri pattern:

MATCH (n:Resource:owl__Class) 
WHERE n.uri STARTS WITH 'http://' 
RETURN count(n)

Alternatively, you can use the importOntology procedure if you're ok with a simplified version of the ontology that keeps only named classes (and excludes all the more complex definitions mentioned above). Check the documentation for details. Here's how you would do it:
CALL semantics.importOntology("", "RDF/XML")

What's the intended use of the ontology in Neo4j? Can you share a bit more of what you're trying to achieve?

Hope this helps,


Hi, JB,

Thank you for the prompt answer!

Here's what we're trying to accomplish at Hopkins. We're working on a terminology service based on OWL ontologies in biomedical research. We're very excited to learn that neo4j is aiming to provide support for RDF data from your presentation yesterday. We're experimenting with the possibility of loading OWL ontologies, and possibly ontologies in other format into neo4j and build an FHIR (Fast Healthcare Interoperability Resources) API on top. We're also interested in using neo4j as a way to combine FHIR models since FHIR has standardized support of RDF as a transmission format.

Would you be able to have a talk with us? Several people in our group are very interested in the possibility of neo4j with RDF. You can directly email me at



1 Like

Sure! I'll email you directly.