I am new in the field of JENA,so don't laugh at me about this
question,please.
My question is about the blank node,since I have no idea how to treat them.
When I list the root class of a OWL file,there are a lot of blank
nodes,even more than the class with URI.Such as

http://xmlns.com/wordnet/1.6/Agent-3
-51cb51a0:134b85abd5d:-7fd3
-51cb51a0:134b85abd5d:-7fc1
-51cb51a0:134b85abd5d:-7fc4
-51cb51a0:134b85abd5d:-7fc7
-51cb51a0:134b85abd5d:-7fca
-51cb51a0:134b85abd5d:-7fcc
-51cb51a0:134b85abd5d:-7fce
-51cb51a0:134b85abd5d:-7fd1

1.the first question is that why there are so many blank nodes created as
root class and what's the usage of them?

then,when I list the statements of the file,I found there are also many
statements with blank node ,for example:
class: -51cb51a0:134b85abd5d:-7fcc
 [-51cb51a0:134b85abd5d:-7fcc, http://www.w3.org/2002/07/owl#minCardinality,
"1"^^http://www.w3.org/2001/XMLSchema#nonNegativeInteger]
 [-51cb51a0:134b85abd5d:-7fcc, http://www.w3.org/2002/07/owl#onProperty,
http://www.mindswap.org/2004/owl/funding#source]
 [-51cb51a0:134b85abd5d:-7fcc,
http://www.w3.org/1999/02/22-rdf-syntax-ns#type,
http://www.w3.org/2002/07/owl#Restriction]
class:-51cb51a0:134b85abd5d:-7fce
 [-51cb51a0:134b85abd5d:-7fce, http://www.w3.org/2002/07/owl#someValuesFrom,
http://www.mindswap.org/2004/owl/funding#Funding]
 [-51cb51a0:134b85abd5d:-7fce, http://www.w3.org/2002/07/owl#onProperty,
http://www.mindswap.org/2004/owl/funding#fundedBy]
 [-51cb51a0:134b85abd5d:-7fce,
http://www.w3.org/1999/02/22-rdf-syntax-ns#type,
http://www.w3.org/2002/07/owl#Restriction]

2.the second question is that why do these blank nodes exist? I can't find
them in the Protégé gragh ,but only see them when I parse the file with
JENA.

Another situation is that when you list all the statements of a class which
have URI, some statements are very similar,since the subject and predicate
of the statement are same while one object is a resource with URI and
another is a blank node.for example
the statements for class  http://www.owl-ontologies.com/animal.owl#Giraffe is
three
 [http://www.owl-ontologies.com/animal.owl#Giraffe,
http://www.w3.org/2000/01/rdf-schema#subClassOf, 72947f0e:134b7e616e0:-7ff9]
 [http://www.owl-ontologies.com/animal.owl#Giraffe,
http://www.w3.org/2000/01/rdf-schema#subClassOf,
http://www.owl-ontologies.com/animal.owl#Herbivore]
 [http://www.owl-ontologies.com/animal.owl#Giraffe,
http://www.w3.org/1999/02/22-rdf-syntax-ns#type,
http://www.w3.org/2002/07/owl#Class]

3.the third question is that is the blank node( 72947f0e:134b7e616e0:-7ff9 )
here a  complement or equal class of
http://www.owl-ontologies.com/animal.owl#Herbivore.If it is ,why  to
created a blank node ?

Because I want to receate a model with part of the information from another
model,so I list all the statements and add them to the new CreatedModel.But
I don't know how to deal with the ones with blank node.If I ignore
them,that't OK.the new model have no problems.But I add the ones with blank
node,there are always display errors.such as

Exception in thread "main" com.hp.hpl.jena.ontology.ConversionException:
Cannot convert node 2761081c:134b875e25b:-7ffb to OntClass: it does not
have rdf:type owl:Class or equivalent
 at com.hp.hpl.jena.ontology.impl.OntClassImpl$1.wrap(OntClassImpl.java:82)
 at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:142)
at com.hp.hpl.jena.enhanced.EnhNode.convertTo(EnhNode.java:22)
 at com.hp.hpl.jena.enhanced.Polymorphic.asInternal(Polymorphic.java:54)
at com.hp.hpl.jena.enhanced.EnhNode.as(EnhNode.java:97)
 at
com.hp.hpl.jena.ontology.impl.OntResourceImpl$ObjectAsMapper.map1(OntResourceImpl.java:1607)
 at
com.hp.hpl.jena.ontology.impl.OntResourceImpl$ObjectAsMapper.map1(OntResourceImpl.java:1601)
 at com.hp.hpl.jena.util.iterator.Map1Iterator.next(Map1Iterator.java:35)
at
com.hp.hpl.jena.ontology.impl.OntResourceImpl.computeDirectValues(OntResourceImpl.java:1493)
 at
com.hp.hpl.jena.ontology.impl.OntResourceImpl.listDirectPropertyValues(OntResourceImpl.java:1466)
 at
com.hp.hpl.jena.ontology.impl.OntClassImpl.listSuperClasses(OntClassImpl.java:195)
 at
com.hp.hpl.jena.ontology.impl.OntClassImpl.isHierarchyRoot(OntClassImpl.java:722)
 at
com.hp.hpl.jena.ontology.impl.OntModelImpl$1.accept(OntModelImpl.java:527)
 at
com.hp.hpl.jena.ontology.impl.OntModelImpl$1.accept(OntModelImpl.java:524)
at
com.hp.hpl.jena.util.iterator.FilterKeepIterator.accept(FilterKeepIterator.java:22)
 at
com.hp.hpl.jena.util.iterator.FilterIterator.hasNext(FilterIterator.java:44)

But when I add all the namespace of another model to the new one and want
to create a blank node with given name then add it to the model to solve
it,it doesn't work.My method is that
Resource s = CreatedModel.createResource("
http://www.owl-ontologies.com/animal.owl#Herbivore";);
Property p = CreatedModel.createProperty("
http://www.w3.org/2000/01/rdf-schema#subClassOf";);
Resource o = CreatedModel.createResource(new
AnonId("72947f0e:134b7e616e0:-7ff8"));
CreatedModel.add(s,p,o);

After this process, when I list the statement of the CreatedModel, the new
created blank node is not  72947f0e:134b7e616e0:-7ff8, but a random one.

4.So the last question is that could I ignore the statements with blank
node when I recreate a new model , will this affect the result ?Or how to
create and add a new created blank node with given name to the model?


I am very graceful for who can help!
Best Wishes!

Reply via email to