jena-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 锐光刘 <tidus...@gmail.com>
Subject Could I ignore the blank node ?Or what's the usage of them?
Date Sun, 08 Jan 2012 09:11:25 GMT
Dear DAVE,
I am still graceful for your help again.With your help, I learn a
lot.Thanks sincerely!
As you told me ,the blank nodes in RDFS  are restrictions classes,so they
always located at the root,since some other classes with the same restrictions
just belong to the subclass?That is to say the blank node are same as the
global parameters in JAVA.Is this the truth?Wish my understanding is right
:)
However, the problems of mine are still pending.As you told me, I have
tried the ways to create blank node,it does work !
But I still confuse with the name of blank node? Every time, the name of
one certain blank node are same in the places it appeals,while the serious
number is changing each time of running.It seems the number is created
randomly for every blank node,right?So it's proved fault to create a blank
node with certain given name such as ( -c125e31:134bc22d954:-7ffc ),because
it doesn't work.
So far, my project is still held on.As you already know,I want to create a
new model(m2) merely containing part of information from another
model(m1).So I add the concerned statements to m2,while the obstacle is
apparent.If the statement contain a blank node, such as (
[-c125e31:134bc22d954:-7ff9,
http://www.w3.org/2002/07/owl#allValuesFrom,
http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLClass_00000011048271017738]
).It is meaningless,since the name of blank node have no meaning.
In view of this situation, I have my solution but don't know whether it is
correct or have some leaks without taking into accounts.

1.create a OntModel named m2 and add all namespace from raw model m1 to
keep the same name prefix.
2.Since most blank nodes are the root class for restriction, so put the
statements of one blank node into a list and then create a new blank node
with the same predicate and object.At last, add them to the model m2, for
example:

There are three statement about the blank node called (
-c125e31:134bc22d954:-7ff9) here

[-c125e31:134bc22d954:-7ff9, http://www.w3.org/2002/07/owl#allValuesFrom,
http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLClass_00000011048271017738
]
[-c125e31:134bc22d954:-7ff9, http://www.w3.org/2002/07/owl#onProperty,
http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLObjectProperty_00000007999444084524
]
[-c125e31:134bc22d954:-7ff9, http://www.w3.org/1999/02/22-rdf-syntax-ns#type,
http://www.w3.org/2002/07/owl#Restriction]


Resource s1 = CreatedModel.createResource(new AnonId()); Property p1 =
CreatedModel.createProperty("http://www.w3.org/2002/07/owl#someValuesFrom");
RDFNode o1 = CreatedModel.createResource("
http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLClass_00000007917927734386");
Property pp1 = CreatedModel.createProperty("
http://www.w3.org/2002/07/owl#onProperty"); RDFNode  oo1 =
CreatedModel.createResource("
http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLObjectProperty_00000009464787570107");
Property ppp1 = CreatedModel.createProperty("
http://www.w3.org/1999/02/22-rdf-syntax-ns#type"); RDFNode  ooo1 =
CreatedModel.createResource("http://www.w3.org/2002/07/owl#Restriction");
m2.add(s1, p1, o1); m2.add(s1, pp1, oo1); m2.add(s1, ppp1, ooo1);


For all the blank nodes ,dealt with them as the same way.After this
process, all the blank node are add into the OntModel m2,no matter whether
they are used.
At the end of step 2,the m2 contains namespace and the blank nodes with
properties with them.And the statements list from m1 can deleted the ones
which contain the blank nodes as subject,since they these statements are
already contained in m2.

3.Add the other needed statements to the m2,if encounter some statements
mentioning blank nodes as objects,(since the ones with blank nodes as
subjects are already contained in step 2).Relplace the blank node with the
corresponding created one(such as s1 above in step 2),and then add the
statememts to the model m2.for example

[
http://www.semanticweb.org/ontologies/2011/2/Ontology1300069908451.owl#OWLClass_00000010519829538601,
http://www.w3.org/2002/07/owl#equivalentClass, -c125e31:134bc22d954:-7ffa]
The object ( -c125e31:134bc22d954:-7ffa) is a blank node, so replace it
then add it to m2.
Of course,the statements belong to one resource such as class and
individual should be added together.

Well,Could you tell me the faults of this solution or whether it is
feasible in theory? Since this way should store the infomation during
process,needing to redesign a database and store the statements with label
to them.So I have done the procee at the second step,and it seems all
right.The third step haven't done for the reason of new database.If I
describe ambiguously, I am pleasure to explain in details.
So could you tell me could my solution will be work? Thanks very much!
Sincerely Lucas

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message