Importing and exporting RDF data with blank nodes

Hi! I am working with ontologies and Linked Data for several years for now, but I'm quite new to Neo4j and n10s.

I imported an ontology using n10s.rdf.import.fetch. Here is an example:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ercm: <http://erlangen-crm.org/current/> .

ercm:E1_CRM_Entity a owl:Class ;
    rdfs:label "E1 CRM Entity"@en ;
    rdfs:subClassOf [ a owl:Restriction ;
            owl:maxCardinality "1"^^xsd:long ;
            owl:onProperty ercm:P48_has_preferred_identifier ],
        owl:Thing .
ercm:P48_has_preferred_identifier a owl:ObjectProperty ;
    rdfs:label "P48 has preferred identifier"@en .

There is an owl:Restriction which is a blank node. The blank node was imported as a node having URI that looked like 'bnode://node1fl8msbobx8'. When I tried to export RDF triples back, I got the following result:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ercm: <http://erlangen-crm.org/current/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ercm:E1_CRM_Entity a owl:Class;
  rdfs:label "E1 CRM Entity"@en;
  rdfs:subClassOf owl:Thing,
    <bnode://node1fl8msbobx8> .

<bnode://node1fl8msbobx8> a owl:Restriction;
  owl:onProperty ercm:P48_has_preferred_identifier;
  owl:maxCardinality "1"^^xsd:long .

ercm:P48_has_preferred_identifier a owl:ObjectProperty;
  rdfs:label "P48 has preferred identifier"@en .

The restriction wasn't exported as a blank node. Nor Protege, nor Pellet reasoner recognized it as a blank node.

Did I do something wrong?

Thanks.

Hi @a.seryj ,
Thanks for your question. You did not do anything wrong. That is the current behavior of n10s which is probably not ideal but in order for us to understand how to fix it, could you explain why is it a problem that this resource becomes a URI identified one instead of a blank node?

I understand the difference between blank nodes and URIs what I'm trying to understand is what is the actual problem you find when reimporting the RDF with pellet or protege? Does it throw a parser error? Or does it just look different? Because semantically it should not make any real difference, am I wrong?

Thanks!

JB.

Hi, @jesus_barrasa ! Thanks for the reply.

We seek to provide an ontology both as a graph and as an OWL file keeping compatibility. Domain experts maintain the ontology in Protege, then we add changes to the graph.
And here is where the blank node problem stands. After the blank nodes obtain URIs Protege starts showing them in the class hierarchy window, which is not very handy.
Actually, I solved this problem by adding to my exporting script a functions that replaces strings like "bnode://generated_name" with "_:generated_name", and it works well.

Sorry for the late answer. My google mailbox dumped the notification to the spam folder for some reason.

And sorry for my English too :)