Re: Are there graph/table based tools for browsing/editing a large TDB store?

2014-11-25 Thread Deyan Chen

Hi kamalraj,

Thank you for your reply.
Now the size of my ontology is about 2GB.
I mainly want to supply an ontology maintenance tool for business 
professionals so as to
they can  easily browse or edit the ontology data(especially instance 
data and their relationships).

And I hope this tool can support blank node.

Deyan Chen

在 2014年11月26日 09:49, Kamalraj Jairam 写道:

Hello Deyan,

How big is the ontology?

Do you want to prune ontology or edit the ontology by adding and deleting 
axioms?

Thanks
Kamalraj


On 26 Nov 2014, at 12:26 pm, Deyan Chen 
mailto:chende...@neusoft.com>> wrote:

Hi all,

I want a graph/table based tool to browse/edit an large ontology stored in a 
TDB store.
Although Protege is a very good ontology editor, it needs a large amount of 
memory resources to open an large ontology file. And both desktop Protege and 
Web Protege cannot access TDB store.
Any suggestions or recommendation would be appreciated.
Thank you very much.

Deyan Chen




---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Are there graph/table based tools for browsing/editing a large TDB store?

2014-11-25 Thread Deyan Chen

Hi all,

I want a graph/table based tool to browse/edit an large ontology stored 
in a TDB store.
Although Protege is a very good ontology editor, it needs a large amount 
of memory resources to open an large ontology file. And both desktop 
Protege and Web Protege cannot access TDB store.

Any suggestions or recommendation would be appreciated.
Thank you very much.

Deyan Chen
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Re: How to get all leaf subclass nodes in class view

2014-10-10 Thread Deyan Chen

在 2014年10月10日 22:25, Joshua TAYLOR 写道:

Are you asking how to get classes that don't have any (declared,
nontrivial, etc.) subclasses?  You could do that with the Jena Model
API, but a SPARQL query here would be *very* simple:

select ?class where {
   ?leaf a rdfs:Class .
   filter not exists { ?subleaf rdfs:subClassOf ?leaf }
}

Yes.
I don't find a convenient Jena Model API to do that. But the above 
SPARQL query is really very simple.

Thank you very much.



On Fri, Oct 10, 2014 at 10:11 AM, Deyan Chen  wrote:

在 2014年10月10日 19:40, Joshua TAYLOR 写道:

On Thu, Oct 9, 2014 at 11:23 PM, Deyan Chen  wrote:

class view

What is class view?

Maybe my expression is not right. It means class hierarchical structure in
an ontology schema.

---
Confidentiality Notice: The information contained in this e-mail and any
accompanying attachment(s) is intended only for the use of the intended
recipient and may be confidential and/or privileged of Neusoft Corporation,
its subsidiaries and/or its affiliates. If any reader of this communication
is not the intended recipient, unauthorized use, forwarding, printing,
storing, disclosure or copying is strictly prohibited, and may be
unlawful.If you have received this communication in error,please immediately
notify the sender by return e-mail, and delete the original message and all
copies from your system. Thank you.
---





---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Re: How to get all leaf subclass nodes in class view

2014-10-10 Thread Deyan Chen

在 2014年10月10日 19:40, Joshua TAYLOR 写道:

On Thu, Oct 9, 2014 at 11:23 PM, Deyan Chen  wrote:

class view

What is class view?
Maybe my expression is not right. It means class hierarchical structure 
in an ontology schema.




---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


How to get all leaf subclass nodes in class view

2014-10-09 Thread Deyan Chen

Hi all,

Is there a convenient way to get all leaf subclass nodes in class view?

Any suggestions and ideas are always welcome.

Thanks in advance.

Deyan Chen
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Re: How to associate a triple with a weight value?

2014-09-18 Thread Deyan Chen

Hi Dave,

Your explains and suggestions are very helpful to me.
Thank you very much.

Deyan Chen

在 2014年09月18日 16:44, Dave Reynolds 写道:

On 18/09/14 09:26, Deyan Chen wrote:



在 2014年09月18日 15:32, Dave Reynolds 写道:

On 18/09/14 01:31, Deyan Chen wrote:

Hi Dave,

Thank you for your reply.

I know the means of the error, but I want to know why the second
case(model created by Model.union()) doesn't report the error.


Presumably because in that case you are using TDB instead of an
in-memory data structure.


The model in my first test cast was created from TDB store and an
in-memory data structure individually, it reported the same error.


Since you didn't show us that code it is hard to say but it looks like 
you are running over an in-memory copy.


In the second case your updates are going straight to TDB.

As it happens you are also using different models for the read and 
writes. The updates are going into the default graph of TDB and the 
reads are coming from a union of the named graphs in the TDB. However, 
for TDB models are really just projections out of a quad store so 
that's not particularly relevant.


If you are going to do this sort of thing with TDB then use transactions.

And about the way to associate a triple with a weight value, have 
you a

better one or any other suggestions?


Apart from reification at the RDF level the alternative is to consider
explicit n-ary relations. The implementation of n-ary relations boils
down to something much the same as reification - create resources,
typically b-nodes, to represent each instance of the relation with
separate properties to link that instance to the relation components
(such as subject, object, weight).

It depends on whether you really are trying to annotate every RDF
statement or whether you want to build on top of RDF some way of
representing certain weighted property values.


I want to represent weighted property values on some RDF triples, such
as, disease and symptom relations.


Personally I would represent those with n-ary relations rather than 
RDF-level reification but either could be made to work.


--- 



Confidentiality Notice: The information contained in this e-mail and any
accompanying attachment(s) is intended only for the use of the intended
recipient and may be confidential and/or privileged of Neusoft
Corporation, its subsidiaries and/or its affiliates. If any reader of
this communication is not the intended recipient, unauthorized use,
forwarding, printing,  storing, disclosure or copying is strictly
prohibited, and may be unlawful.If you have received this communication
in error,please immediately notify the sender by return e-mail, and
delete the original message and all copies from your system. Thank you.
--- 



This is a public forum :)

Dave






---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Re: How to associate a triple with a weight value?

2014-09-18 Thread Deyan Chen



在 2014年09月18日 15:32, Dave Reynolds 写道:

On 18/09/14 01:31, Deyan Chen wrote:

Hi Dave,

Thank you for your reply.

I know the means of the error, but I want to know why the second
case(model created by Model.union()) doesn't report the error.


Presumably because in that case you are using TDB instead of an 
in-memory data structure.


The model in my first test cast was created from TDB store and an 
in-memory data structure individually, it reported the same error.





And about the way to associate a triple with a weight value, have you a
better one or any other suggestions?


Apart from reification at the RDF level the alternative is to consider 
explicit n-ary relations. The implementation of n-ary relations boils 
down to something much the same as reification - create resources, 
typically b-nodes, to represent each instance of the relation with 
separate properties to link that instance to the relation components 
(such as subject, object, weight).


It depends on whether you really are trying to annotate every RDF 
statement or whether you want to build on top of RDF some way of 
representing certain weighted property values.


I want to represent weighted property values on some RDF triples, such 
as, disease and symptom relations.


Thank you very much.

Deyan Chen



Dave


Thank you very much.

Deyan Chen

在 2014年09月17日 17:13, Dave Reynolds 写道:


On 17/09/14 10:01, Deyan Chen wrote:

Hi all,

I want to associate a triple with a weight value, for example:

s1 p1 v1 with 20,
s1 p1 v2 with 11,
s1 p2 v3 with 30,
..
s2 p1 v1 with 15,
s2 p2 v3 with 20,
..

The way I have tested is to make a anonymous ReifiedStatement object
from the triple/statement.
The example code is as following:

// list the statements in the graph
StmtIterator stmtIter = model.listStatements(res, prop, (RDFNode) 
null);


Property certaintyFactor = model.createProperty(fuzzyOntNameSpace,
"certainty_factor");

// print out the predicate, subject and object of each statement
Statement stmt = null;

while (stmtIter.hasNext()) {
 // get next statement
 stmt = stmtIter.nextStatement();
 System.out.println(stmt.toString());

 if (stmt.isReified()) {
 stmt.removeReification();
 } else {
 ReifiedStatement reifStmt = stmt.createReifiedStatement();
 reifStmt.addLiteral(certaintyFactor, Math.random());


N.B. This modifies the model you are iterating over.


System.out.println(reifStmt.toString());
 }
}

The output is as following:

[http://www.example.com/ontologies/2013/6/medicine.owl#m.029k_,
http://www.example.com/ontologies/2013/6/medicine.owl#disease.symptoms, 


http://www.example.com/ontologies/2013/6/medicine.owl#m.014wq_]
(273851cd:146eb73208f:-7fea rdf:type rdf:Statement)
(273851cd:146eb73208f:-7fea rdf:subject medicine:m.029k_)
(273851cd:146eb73208f:-7fea rdf:predicate medicine:disease.symptoms)
(273851cd:146eb73208f:-7fea rdf:object medicine:m.014wq_)
(273851cd:146eb73208f:-7fea fuzzy:certainty_factor
'0.6892811680228655'^^http://www.w3.org/2001/XMLSchema#double)
Exception in thread "main" java.util.ConcurrentModificationException:


As the error says, you are modifying a data structure while still
iterating over it.

Depending on the reification style the reification statements
themselves may be visible but in any case the step noted above
definitely adds statements to the model you are scanning.

The thing to do is the build up a separate list of modification
actions during the iteration and then afterwards perform all those
modifications.

Dave




--- 



Confidentiality Notice: The information contained in this e-mail and any
accompanying attachment(s) is intended only for the use of the intended
recipient and may be confidential and/or privileged of Neusoft
Corporation, its subsidiaries and/or its affiliates. If any reader of
this communication is not the intended recipient, unauthorized use,
forwarding, printing,  storing, disclosure or copying is strictly
prohibited, and may be unlawful.If you have received this communication
in error,please immediately notify the sender by return e-mail, and
delete the original message and all copies from your system. Thank you.
--- 





.



---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have r

Re: How to associate a triple with a weight value?

2014-09-17 Thread Deyan Chen

Hi Dave,

Thank you for your reply.

I know the means of the error, but I want to know why the second 
case(model created by Model.union()) doesn't report the error.


And about the way to associate a triple with a weight value, have you a 
better one or any other suggestions?


Thank you very much.

Deyan Chen

在 2014年09月17日 17:13, Dave Reynolds 写道:


On 17/09/14 10:01, Deyan Chen wrote:

Hi all,

I want to associate a triple with a weight value, for example:

s1 p1 v1 with 20,
s1 p1 v2 with 11,
s1 p2 v3 with 30,
..
s2 p1 v1 with 15,
s2 p2 v3 with 20,
..

The way I have tested is to make a anonymous ReifiedStatement object
from the triple/statement.
The example code is as following:

// list the statements in the graph
StmtIterator stmtIter = model.listStatements(res, prop, (RDFNode) null);

Property certaintyFactor = model.createProperty(fuzzyOntNameSpace,
"certainty_factor");

// print out the predicate, subject and object of each statement
Statement stmt = null;

while (stmtIter.hasNext()) {
 // get next statement
 stmt = stmtIter.nextStatement();
 System.out.println(stmt.toString());

 if (stmt.isReified()) {
 stmt.removeReification();
 } else {
 ReifiedStatement reifStmt = stmt.createReifiedStatement();
 reifStmt.addLiteral(certaintyFactor, Math.random());


N.B. This modifies the model you are iterating over.


System.out.println(reifStmt.toString());
 }
}

The output is as following:

[http://www.example.com/ontologies/2013/6/medicine.owl#m.029k_,
http://www.example.com/ontologies/2013/6/medicine.owl#disease.symptoms,
http://www.example.com/ontologies/2013/6/medicine.owl#m.014wq_]
(273851cd:146eb73208f:-7fea rdf:type rdf:Statement)
(273851cd:146eb73208f:-7fea rdf:subject medicine:m.029k_)
(273851cd:146eb73208f:-7fea rdf:predicate medicine:disease.symptoms)
(273851cd:146eb73208f:-7fea rdf:object medicine:m.014wq_)
(273851cd:146eb73208f:-7fea fuzzy:certainty_factor
'0.6892811680228655'^^http://www.w3.org/2001/XMLSchema#double)
Exception in thread "main" java.util.ConcurrentModificationException:


As the error says, you are modifying a data structure while still 
iterating over it.


Depending on the reification style the reification statements 
themselves may be visible but in any case the step noted above 
definitely adds statements to the model you are scanning.


The thing to do is the build up a separate list of modification 
actions during the iteration and then afterwards perform all those 
modifications.


Dave




---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


How to associate a triple with a weight value?

2014-09-17 Thread Deyan Chen

Hi all,

I want to associate a triple with a weight value, for example:

s1 p1 v1 with 20,
s1 p1 v2 with 11,
s1 p2 v3 with 30,
..
s2 p1 v1 with 15,
s2 p2 v3 with 20,
..

The way I have tested is to make a anonymous ReifiedStatement object 
from the triple/statement.

The example code is as following:

// list the statements in the graph
StmtIterator stmtIter = model.listStatements(res, prop, (RDFNode) null);

Property certaintyFactor = model.createProperty(fuzzyOntNameSpace, 
"certainty_factor");


// print out the predicate, subject and object of each statement
Statement stmt = null;

while (stmtIter.hasNext()) {
// get next statement
stmt = stmtIter.nextStatement();
System.out.println(stmt.toString());

if (stmt.isReified()) {
stmt.removeReification();
} else {
ReifiedStatement reifStmt = stmt.createReifiedStatement();
reifStmt.addLiteral(certaintyFactor, Math.random());
System.out.println(reifStmt.toString());
}
}

The output is as following:

[http://www.example.com/ontologies/2013/6/medicine.owl#m.029k_, 
http://www.example.com/ontologies/2013/6/medicine.owl#disease.symptoms, 
http://www.example.com/ontologies/2013/6/medicine.owl#m.014wq_]

(273851cd:146eb73208f:-7fea rdf:type rdf:Statement)
(273851cd:146eb73208f:-7fea rdf:subject medicine:m.029k_)
(273851cd:146eb73208f:-7fea rdf:predicate medicine:disease.symptoms)
(273851cd:146eb73208f:-7fea rdf:object medicine:m.014wq_)
(273851cd:146eb73208f:-7fea fuzzy:certainty_factor 
'0.6892811680228655'^^http://www.w3.org/2001/XMLSchema#double)
Exception in thread "main" java.util.ConcurrentModificationException: 
Iterator: started at 5, now 10
at 
com.hp.hpl.jena.tdb.sys.DatasetControlMRSW.policyError(DatasetControlMRSW.java:157)
at 
com.hp.hpl.jena.tdb.sys.DatasetControlMRSW.access$000(DatasetControlMRSW.java:32)
at 
com.hp.hpl.jena.tdb.sys.DatasetControlMRSW$IteratorCheckNotConcurrent.checkCourrentModification(DatasetControlMRSW.java:110)
at 
com.hp.hpl.jena.tdb.sys.DatasetControlMRSW$IteratorCheckNotConcurrent.hasNext(DatasetControlMRSW.java:118)

at org.apache.jena.atlas.iterator.Iter$4.hasNext(Iter.java:295)
at org.apache.jena.atlas.iterator.Iter$4.hasNext(Iter.java:295)
at org.apache.jena.atlas.iterator.Iter.hasNext(Iter.java:853)
at 
com.hp.hpl.jena.tdb.store.GraphTDBBase$ProjectQuadsToTriples.hasNext(GraphTDBBase.java:170)
at 
com.hp.hpl.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
at 
com.hp.hpl.jena.util.iterator.Map1Iterator.hasNext(Map1Iterator.java:48)
at 
com.hp.hpl.jena.util.iterator.WrappedIterator.hasNext(WrappedIterator.java:90)
at 
com.neusoft.phs.diagnosis.FindDiseasesBySymptoms.setWeightForSymptomsOfDisease(FindDiseasesBySymptoms.java:117)
at 
com.neusoft.phs.diagnosis.FindDiseasesBySymptoms.main(FindDiseasesBySymptoms.java:60)

Java Result: 1

Only the first time of this cycle is successful. And whether the model 
is located in memory or TDB, the test result is same.


But when the model is created by Model.union() method, for example:

Dataset dataset = TDBFactory.assembleDataset(assemblerFile);
Model defaultModel = dataset.getDefaultModel();
Model unionNamedModel = dataset.getNamedModel("urn:x-arq:UnionGraph");
Model model = defaultModel.union(unionNamedModel);

the above cycle can execute successfully. I don't know why.

Have I done something wrong? Could anyone help on this or give me any 
suggestions?


Thank you very much.

Deyan Chen
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Why don't provide performance test results of TDB?

2014-08-20 Thread Deyan Chen

Hi Andy,

I see the performance test results of SDB on different SQL DBs in Jena 
website, but I don't find similar tests for TDB.


I want to know that if there are some performance evaluation results for 
TDB.


Thank you very much.

Deyan Chen
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


An error reported by the TurtleOntologyParser of the Protege

2014-08-14 Thread Deyan Chen

Hi all,

When I try to open an example.ttl ontology using Protege, the protege's 
TurtleOntologyParser reports the following error:


uk.ac.manchester.cs.owl.owlapi.turtle.parser.ParseException: Encountered 
"  
"<http://www.example.com/ontologies/2014/6/medicine#medicine.drug_strength.strength_value> 
"" at line 5950904, column 65.

Was expecting:
"." ...

Then I find the triple at line 5950904:

<http://www.example.com/ontologies/2014/6/medicine#m.0hycptl> 
<http://www.example.com/ontologies/2014/6/medicine#medicine.drug_strength.strength_value> 
8e-05 .


But I can't find any problems in this triple. And TurtleOntologyParser 
can parse the following similar triples successfully:


..
<http://www.example.com/ontologies/2014/6/medicine#m.0hyckjg> 
<http://www.example.com/ontologies/2014/6/medicine#medicine.drug_strength.strength_value> 
0.03 .
<http://www.example.com/ontologies/2014/6/medicine#m.0hyckjg> 
<http://www.example.com/ontologies/2014/6/medicine#medicine.drug_strength.strength_value> 
20.0 .
<http://www.example.com/ontologies/2014/6/medicine#m.0hyckjg> 
<http://www.example.com/ontologies/2014/6/medicine#medicine.drug_strength.strength_value> 
30.0 .
<http://www.example.com/ontologies/2014/6/medicine#m.0hyckjg> 
<http://www.example.com/ontologies/2014/6/medicine#medicine.drug_strength.strength_value> 
3.5 .

..

When I change '8e-05' to '8.05', it can parse it successfully. But when 
I change to '8e.05' or '8-05', it reports the same error.


Can anyone tell me why?

Thank you very much.

Deyan Chen
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Re: Errors when loading basekb dumps into TDB

2014-08-08 Thread Deyan Chen

Hi Andy,

Thank you for your answer.

The syntax format of Freebase dumps is indeed N-Triples, but I don't 
know why it includes these illegal triples(not N-Triples).


BaseKB split Freebase dump into 1024 dumps and compress them with gzip. 
But these dumps don't include any file extension.


According to tdbloader tests and your answer, If I can think that legal 
N-Triples is also legal Turtle or N3 but not vice versa?


Deyan Chen

在 2014年08月08日 15:21, Andy Seaborne 写道:

On 08/08/14 05:02, Deyan Chen wrote:

Hi Andy,

Basekb dumps come from freebase dump and their data format is N-Triples
RDF.
So for each basekb dump, it is uncompressed, attached a extension '.nt'
and then loaded into TDB.

But the tdbloader reports the following error:

15:19:22 ERROR riot :: [line: 309035, col: 135] Illegal
object: [INTEGER:5281023]
org.apache.jena.riot.RiotException: [line: 309035, col: 135] Illegal
object: [INTEGER:5281023]

...



And then, I print the triple:

<http://www.neusoft.com/ontologies/2013/6/medicine#m.07_71>
<http://www.neusoft.com/ontologies/2013/6/medicine#medicine.drug.pubchem> 
5281023

.

It should be that tdbloader can't decide on the type of the object.
There are also many triples like this.

Then I change the extension from '.nt' to '.n3' and then reload these
dumps.
This time tdbloader load all the dumps into the TDB store without
reporting any errors.
And I can query all triples from the TDB store.

But I don't know why tdbloader don't check these errors any more when
the extension is '.n3'.

Thank you very much.

Deyan Chen


Hi there,

A integer written 5281023 isn't legal N-Triples - it is legal Turtle 
(and N3 though).


In N-triples it's

 "5281023"^^<http://www.w3.org/2001/XMLSchema#integer>

with no alternative short form.

It is a good idea to parse data to check before loading; call "riot 
--validate".


if the files are compressed with gzip, you can use those directly.  
RIOT looks for file extension .gz, adds a decompressor, strips then 
looks at the next file extension to get the syntax type.


Generally, don't use N3 , use Turtle, which is a W3C standard. There 
is some variety around the details of N3.  Turtle is more rigorously 
defined and the syntax details like prefix names, aligns with SPARQL. 
Jena treats N3 as Turtle.   There is more to N3 than just the data 
format (like N3 formulae).


Andy

.



---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Errors when loading basekb dumps into TDB

2014-08-07 Thread Deyan Chen

Hi Andy,

Basekb dumps come from freebase dump and their data format is N-Triples RDF.
So for each basekb dump, it is uncompressed, attached a extension '.nt' 
and then loaded into TDB.


But the tdbloader reports the following error:

15:19:22 ERROR riot :: [line: 309035, col: 135] Illegal 
object: [INTEGER:5281023]
org.apache.jena.riot.RiotException: [line: 309035, col: 135] Illegal 
object: [INTEGER:5281023]
at 
org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)
at 
org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:163)
at 
org.apache.jena.riot.lang.LangEngine.exceptionDirect(LangEngine.java:156)

at org.apache.jena.riot.lang.LangEngine.exception(LangEngine.java:149)
at 
org.apache.jena.riot.lang.LangNTuple.checkRDFTerm(LangNTuple.java:126)
at 
org.apache.jena.riot.lang.LangNTriples.parseOne(LangNTriples.java:78)
at 
org.apache.jena.riot.lang.LangNTriples.runParser(LangNTriples.java:54)

at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at 
org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:169)

at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:859)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:687)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:666)
at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:654)
at 
com.hp.hpl.jena.tdb.store.bulkloader.BulkLoader.loadTriples$(BulkLoader.java:130)
at 
com.hp.hpl.jena.tdb.store.bulkloader.BulkLoader.loadDefaultGraph(BulkLoader.java:87)

at com.hp.hpl.jena.tdb.TDBLoader.loadDefaultGraph$(TDBLoader.java:260)
at com.hp.hpl.jena.tdb.TDBLoader.loadGraph$(TDBLoader.java:243)
at com.hp.hpl.jena.tdb.TDBLoader.loadGraph(TDBLoader.java:176)
at com.hp.hpl.jena.tdb.TDBLoader.load(TDBLoader.java:113)
at tdb.tdbloader.loadDefaultGraph(tdbloader.java:138)
at tdb.tdbloader.exec(tdbloader.java:108)
at arq.cmdline.CmdMain.mainMethod(CmdMain.java:102)
at arq.cmdline.CmdMain.mainRun(CmdMain.java:63)
at arq.cmdline.CmdMain.mainRun(CmdMain.java:50)
at tdb.tdbloader.main(tdbloader.java:52)

And then, I print the triple:

<http://www.neusoft.com/ontologies/2013/6/medicine#m.07_71> 
<http://www.neusoft.com/ontologies/2013/6/medicine#medicine.drug.pubchem> 5281023 
.


It should be that tdbloader can't decide on the type of the object. 
There are also many triples like this.


Then I change the extension from '.nt' to '.n3' and then reload these 
dumps.
This time tdbloader load all the dumps into the TDB store without 
reporting any errors.

And I can query all triples from the TDB store.

But I don't know why tdbloader don't check these errors any more when 
the extension is '.n3'.


Thank you very much.

Deyan Chen
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Re: Whether TDB index has problems?

2014-08-04 Thread Deyan Chen

在 2014年08月04日 19:09, Andy Seaborne 写道:

On 04/08/14 04:21, Deyan Chen wrote:

Hi Andy,

Thank you for your reply.

The Jena version is 2.11.2. The load process was not interrupted.
And I don't perform any update operation on the TDB store by Fuseki
SPARQL endpoint.
Number of triples is about 204,800,000.
Can I control or set the index way of TDB? How to do that If I can?


The indexing is fixed within the code (everything is indexed).

What did

 PREFIX basekb: <http://rdf.basekb.com/>
SELECT * {
  ?s basekb:ns.mid ?o .
  FILTER regex(str(?o), "medic")
}


The output is:

..

| <http://rdf.basekb.com/ns/m.0h8q646> | 
"/medicine/drug_formulation/brand_names" |

| <http://rdf.basekb.com/ns/m.0220pym> | "/medicine/medical_trial" |
| <http://rdf.basekb.com/ns/m.0dbyyxn> | 
"/medicine/medical_trial_phase/medical_trials" |
| <http://rdf.basekb.com/ns/m.04822f4> | 
"/base/bioventurist/bv_medical_condition" |

| <http://rdf.basekb.com/ns/m.070bxqt> | "/medicine/diagnostic_sign/tests"

..

But I can't  find some resources, for example, 
"/medicine/medical_trial_type/medical_trials".




and (you'll possibly want to count for this one)

PREFIX basekb: <http://rdf.basekb.com/>
SELECT * {
  ?s basekb:ns.mid ?object .
}

show?


This time I can find:

| <http://rdf.basekb.com/ns/m.0dbzfg8> | 
"/medicine/medical_trial_type/medical_trials" |




The other good thing to check is to dump the database (stop Fuseki, 
use tdbdump) then see if the triples necessary to match the pattern 
are present.


Only some resources can't be filtered regex operator. But I can get 
related triples by their mids, for example, 'm.0dbzfg8'.
From the output, I think they should match the pattern in the regex 
operator.
When I put these resources into another TDB, I can get them by regex 
operator.

So I still don't know why.



Andy



Regards,

Deyan Chen

在 2014年08月01日 22:49, Andy Seaborne 写道:

On 01/08/14 08:56, Deyan Chen wrote:

hi all,


Hi there,
(version number?)

I don't see anything wrong in what your doing.

Presumably you've tried

PREFIX basekb: <http://rdf.basekb.com/>
SELECT * {
  ?s basekb:ns.mid ?object .
}

and

 PREFIX basekb: <http://rdf.basekb.com/>
SELECT * {
  ?s basekb:ns.mid ?o .
  FILTER (str(?o), "medic")
}

The other possibility is that the initial load was interrupted, a
second JVM accessed the database at some cocurent time or a use of
database was non transaction during an update (Fuseki is 
transactional).




I have loaded a part of basekbpro data into TDB by tdbloader command.
The size of the TDB store is about 26GB.


Number of triples or quads?



Then I use Jena fuseki server to publish the TDB store through a 
SPARQL

endpoint.

But when I run the following SPARQLs:

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
 ?s basekb:ns.mid "/medicine/medical_trial_type/medical_trials" .
?s ?p ?o .
}

or

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
 ?s basekb:ns.mid ?object .
 FILTER regex(?object,
"/medicine/medical_trial_type/medical_trials")
 ?s ?p ?o .
}

There is no any output. When I run the following SPARQL:

PREFIX basekb: <http://rdf.basekb.com/ns/>

CONSTRUCT {basekb:m.0dbzfg8 ?p ?o .}
WHERE
{
 basekb:m.0dbzfg8 ?p ?o .
}

I can get the following output:

<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://www.w3.org/2000/01/rdf-schema#domain>
<http://rdf.basekb.com/ns/m.0220py_> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/rdfs.comment> "Medical trials of this
type."@en .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.property_hints.disambiguator>
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.documented_object.tip> "Medical
trials of this type."@en .
<http://rdf.basekb.com/ns/m.0dbzfg8> <http://rdf.basekb.com/ns.mid>
"/medicine/medical_trial_type/medical_trials" .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.property_hints.display_none>
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.object_hints.best_hrid>
"/medicine/medical_trial_type/medical_trials" .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://www.w3.org/2000/01/rdf-schema#label> "Medical trials"@en .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://www.w3.org/2000/01/rdf-schema#range>
<http://rdf.basekb.com/ns/m.0220pym> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.property_hints.displa

Re: Whether TDB index has problems?

2014-08-03 Thread Deyan Chen

Hi Andy,

Thank you for your reply.

The Jena version is 2.11.2. The load process was not interrupted.
And I don't perform any update operation on the TDB store by Fuseki 
SPARQL endpoint.

Number of triples is about 204,800,000.
Can I control or set the index way of TDB? How to do that If I can?

Regards,

Deyan Chen

在 2014年08月01日 22:49, Andy Seaborne 写道:

On 01/08/14 08:56, Deyan Chen wrote:

hi all,


Hi there,
(version number?)

I don't see anything wrong in what your doing.

Presumably you've tried

PREFIX basekb: <http://rdf.basekb.com/>
SELECT * {
  ?s basekb:ns.mid ?object .
}

and

 PREFIX basekb: <http://rdf.basekb.com/>
SELECT * {
  ?s basekb:ns.mid ?o .
  FILTER (str(?o), "medic")
}

The other possibility is that the initial load was interrupted, a 
second JVM accessed the database at some cocurent time or a use of 
database was non transaction during an update (Fuseki is transactional).




I have loaded a part of basekbpro data into TDB by tdbloader command.
The size of the TDB store is about 26GB.


Number of triples or quads?



Then I use Jena fuseki server to publish the TDB store through a SPARQL
endpoint.

But when I run the following SPARQLs:

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
 ?s basekb:ns.mid "/medicine/medical_trial_type/medical_trials" .
?s ?p ?o .
}

or

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
 ?s basekb:ns.mid ?object .
 FILTER regex(?object, 
"/medicine/medical_trial_type/medical_trials")

 ?s ?p ?o .
}

There is no any output. When I run the following SPARQL:

PREFIX basekb: <http://rdf.basekb.com/ns/>

CONSTRUCT {basekb:m.0dbzfg8 ?p ?o .}
WHERE
{
 basekb:m.0dbzfg8 ?p ?o .
}

I can get the following output:

<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://www.w3.org/2000/01/rdf-schema#domain>
<http://rdf.basekb.com/ns/m.0220py_> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/rdfs.comment> "Medical trials of this 
type."@en .

<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.property_hints.disambiguator>
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.documented_object.tip> "Medical
trials of this type."@en .
<http://rdf.basekb.com/ns/m.0dbzfg8> <http://rdf.basekb.com/ns.mid>
"/medicine/medical_trial_type/medical_trials" .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.property_hints.display_none>
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.object_hints.best_hrid>
"/medicine/medical_trial_type/medical_trials" .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://www.w3.org/2000/01/rdf-schema#label> "Medical trials"@en .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://www.w3.org/2000/01/rdf-schema#range>
<http://rdf.basekb.com/ns/m.0220pym> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/freebase.property_hints.display_orientation>
"vertical"@en .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/2000/01/rdf-schema#Property> .
<http://rdf.basekb.com/ns/m.0dbzfg8>
<http://rdf.basekb.com/ns/m.0j2r9sk> 
<http://rdf.basekb.com/ns/m.01xljp5> .


When I use the following SPARQL to query another object:

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
 ?s basekb:ns.mid "/medicine/medical_trial_phase/medical_trials".
 ?s ?p ?o .
}

or

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
 ?s basekb:ns.mid ?object .
 FILTER regex(?object, 
"/medicine/medical_trial_phase/medical_trials")

 ?s ?p ?o .
}

I can get the following output:

<http://rdf.basekb.com/ns/m.0dbyyxn>
<http://www.w3.org/2000/01/rdf-schema#domain>
<http://rdf.basekb.com/ns/m.0220pzc> .
<http://rdf.basekb.com/ns/m.0dbyyxn>
<http://rdf.basekb.com/ns/freebase.object_hints.best_hrid>
"/medicine/medical_trial_phase/medical_trials" .
<http://rdf.basekb.com/ns/m.0dbyyxn>
<http://rdf.basekb.com/ns/rdfs.comment> "Medical trials of this
phase."@en .
<http://rdf.basekb.com/ns/m.0dbyyxn>
<http://rdf.basekb.com/ns/freebase.property_hints.display_none>
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbyyxn>
<http://rdf.basekb.com/ns/m.0j2r9sk> 
<http://rdf.basekb.com/ns/m.01xljp5> .

<http://rdf.basekb.com/ns/m.0dbyyxn>
<http://rdf.basekb.com/ns/freebase.documented_object.tip> "

Whether TDB index has problems?

2014-08-01 Thread Deyan Chen

hi all,

I have loaded a part of basekbpro data into TDB by tdbloader command. 
The size of the TDB store is about 26GB.


Then I use Jena fuseki server to publish the TDB store through a SPARQL 
endpoint.


But when I run the following SPARQLs:

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
?s basekb:ns.mid "/medicine/medical_trial_type/medical_trials" .
?s ?p ?o .
}

or

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
?s basekb:ns.mid ?object .
FILTER regex(?object, "/medicine/medical_trial_type/medical_trials")
?s ?p ?o .
}

There is no any output. When I run the following SPARQL:

PREFIX basekb: <http://rdf.basekb.com/ns/>

CONSTRUCT {basekb:m.0dbzfg8 ?p ?o .}
WHERE
{
basekb:m.0dbzfg8 ?p ?o .
}

I can get the following output:

<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://www.w3.org/2000/01/rdf-schema#domain> 
<http://rdf.basekb.com/ns/m.0220py_> .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://rdf.basekb.com/ns/rdfs.comment> "Medical trials of this type."@en .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://rdf.basekb.com/ns/freebase.property_hints.disambiguator> 
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://rdf.basekb.com/ns/freebase.documented_object.tip> "Medical 
trials of this type."@en .
<http://rdf.basekb.com/ns/m.0dbzfg8> <http://rdf.basekb.com/ns.mid> 
"/medicine/medical_trial_type/medical_trials" .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://rdf.basekb.com/ns/freebase.property_hints.display_none> 
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://rdf.basekb.com/ns/freebase.object_hints.best_hrid> 
"/medicine/medical_trial_type/medical_trials" .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://www.w3.org/2000/01/rdf-schema#label> "Medical trials"@en .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://www.w3.org/2000/01/rdf-schema#range> 
<http://rdf.basekb.com/ns/m.0220pym> .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://rdf.basekb.com/ns/freebase.property_hints.display_orientation> 
"vertical"@en .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2000/01/rdf-schema#Property> .
<http://rdf.basekb.com/ns/m.0dbzfg8> 
<http://rdf.basekb.com/ns/m.0j2r9sk> <http://rdf.basekb.com/ns/m.01xljp5> .


When I use the following SPARQL to query another object:

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
?s basekb:ns.mid "/medicine/medical_trial_phase/medical_trials".
?s ?p ?o .
}

or

PREFIX basekb: <http://rdf.basekb.com/>

CONSTRUCT {?s ?p ?o .}
WHERE
{
?s basekb:ns.mid ?object .
FILTER regex(?object, "/medicine/medical_trial_phase/medical_trials")
?s ?p ?o .
}

I can get the following output:

<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://www.w3.org/2000/01/rdf-schema#domain> 
<http://rdf.basekb.com/ns/m.0220pzc> .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://rdf.basekb.com/ns/freebase.object_hints.best_hrid> 
"/medicine/medical_trial_phase/medical_trials" .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://rdf.basekb.com/ns/rdfs.comment> "Medical trials of this phase."@en .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://rdf.basekb.com/ns/freebase.property_hints.display_none> 
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://rdf.basekb.com/ns/m.0j2r9sk> <http://rdf.basekb.com/ns/m.01xljp5> .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://rdf.basekb.com/ns/freebase.documented_object.tip> "Medical 
trials of this phase."@en .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type> 
<http://www.w3.org/2000/01/rdf-schema#Property> .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://rdf.basekb.com/ns/freebase.property_hints.display_orientation> 
"vertical"@en .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://www.w3.org/2000/01/rdf-schema#range> 
<http://rdf.basekb.com/ns/m.0220pym> .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://www.w3.org/2000/01/rdf-schema#label> "Medical trials"@en .
<http://rdf.basekb.com/ns/m.0dbyyxn> 
<http://rdf.basekb.com/ns/freebase.property_hints.disambiguator> 
"false"^^<http://www.w3.org/2001/XMLSchema#boolean> .
<http://rdf.basekb.com/ns/m.0dbyyxn> <http://rdf.basekb.com/ns.mid> 
"/medicine/medical_trial_phase/medical_trials" .


I have do another test. I

Re: About meta data search path problem

2014-01-13 Thread Deyan Chen

I see. Thank you very much.

于 2014年01月10日 23:54, Andy Seaborne 写道:

On 10/01/14 11:58, Andy Seaborne wrote:

Could you reopen JENA-525 and record this please?


After investigation, I raised JENA-621 and wrote up a possible fix.

Another workaround is if you put your ont-policy.rdf in the current 
working directory.


Setting the metadata search path explicitly is probably the best 
solution.


Andy




---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


About meta data search path problem

2014-01-10 Thread Deyan Chen

hey,

About meta data (ontology document manager policy file) search path, we 
can get the default search path by the following code,


OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
System.out.println(model.getDocumentManager().getMetadataSearchPath());

The output is as the follows,

file:ont-policy.rdf;file:etc/ont-policy.rdf

In jena 2.10.0, the test result is ok. But I find  jena 2.11.0 only 
support "file:ont-policy.rdf". That is to say, when I place the 
ont-policy.rdf into {project-directory}/etc, it can't find it. When we 
perform the following code to specify it,


model.getDocumentManager().setMetadataSearchPath("file:etc/ont-policy.rdf", 
true);


then it's ok.

deyan chen
---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Re: Problems reading local file (OntDocumentManager/FileManager)

2014-01-09 Thread Deyan Chen

Andy,

I find that the following problem is still not resolved in jena 2.11.0.

deyan chen

于 2013年08月29日 00:44, Andy Seaborne 写道:

Recorded as:
https://issues.apache.org/jira/browse/JENA-525


Should be fixed now, as in your test case works for me.  Please try it 
and let us know if it work for you. The snapshot is rebuilding at the 
moment (so give it about 10 mins from the time of this message).


Andy





---
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---


Re: How to store an ontology model(including base model and imported model) to TDB

2013-08-28 Thread Deyan Chen
Hi Dave,

Than you very much for your reply.

In jena 2.6.4, class ModelFactory provides the following methods:

static ModelMaker createModelRDBMaker(IDBConnection c)
Answer a ModelMaker that accesses database-backed Models on the database
at the other end of the connection c with the usual Standard reification
style.

static ModelMaker createModelRDBMaker(IDBConnection c, ReificationStyle
style)
Answer a ModelMaker that accesses database-backed Models on the database
at the other end of the connection c with the given reification style.

but they have been removed in the later Jena versions.

I have modified my code according to the ways you provide and it works
very well.

Thank you again.

Deyan

于 2013年08月28日 16:07, Dave Reynolds 写道:
> On 28/08/13 04:00, Deyan Chen wrote:
>> Hi all,
>>
>> I want to read an ontology file which imports several other ontology
>> files to a TDB store.
>>
>> The test code is as follows:
>>
>> Dataset ds = TDBFactory.createDataset(location);
>> Model base = ds.getDefaultModel();
>> OntModel model =
>> ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, base);
>> // need to process imports
>> model.read(sourceURL);
>> ds.close();
>>
>> I can get imported model from the ontology model by:
>>
>> ...
>> OntModel model1 = model.getImportedModel(uri);
>> ...
>>
>> But I can't get it from the TDB store. Although I can add these imported
>> models to TDB by method:
>>
>> ds.addNamedModel(uri, model);
>>
>> but it's very inconvenient. Are there any good methods can be used to
>> achieve it automatically?
> When you read an OntModel which does imports processing then it reads
> only the base model into the underlying model and loads the imported
> models separately. How those imported models are stored is defined by
> the OntDocumentManager settings and associated ModelMaker.
>
> It is possible to arrange for the imported models to be persisted in a
> store like TDB (e.g. as separate graphs). However, the documentation for
> that is a little out of date and doesn't directly cover the TDB case
> specifically. Have a look at:
> http://jena.apache.org/documentation/ontology/index.html#working-with-persistent-ontologies
>
> [The link to the example code is not working, I suspect because it used
> a now-obsolete persistence module.]
>
> The alternative would be to merge all your data into one model. If you
> don't need the separate submodel mechanism then once your ontology is
> loaded you could list all the submodels and add each of those to your
> base model so that the dataset default graph would then contain the
> union of your ontology and all its imports. When you reopen that TDB
> store in another jvm instance then switch off import processing.
>
> Dave
>
>

---
Confidentiality Notice: The information contained in this e-mail and any 
accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential 
and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of 
this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, 
disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this 
communication in error,please 
immediately notify the sender by return e-mail, and delete the original message 
and all copies from 
your system. Thank you. 
---


How to store an ontology model(including base model and imported model) to TDB

2013-08-27 Thread Deyan Chen
Hi all,

I want to read an ontology file which imports several other ontology
files to a TDB store.

The test code is as follows:

Dataset ds = TDBFactory.createDataset(location);
Model base = ds.getDefaultModel();
OntModel model =
ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM, base);
// need to process imports
model.read(sourceURL);
ds.close();

I can get imported model from the ontology model by:

...
OntModel model1 = model.getImportedModel(uri);
...

But I can't get it from the TDB store. Although I can add these imported
models to TDB by method:

ds.addNamedModel(uri, model);

but it's very inconvenient. Are there any good methods can be used to
achieve it automatically?

Thank you very much.

Deyan

---
Confidentiality Notice: The information contained in this e-mail and any 
accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential 
and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of 
this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, 
disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this 
communication in error,please 
immediately notify the sender by return e-mail, and delete the original message 
and all copies from 
your system. Thank you. 
---


Re: TDB Problems reading local file

2013-08-26 Thread Deyan Chen
Hi Andy,

I found the same problem as Emilio. It seems that document manager
policy file(etc/ont-policy.rdf) is invalid.

My test code is as follows:

Dataset ds = TDBFactory.createDataset("tdb/mydb");
Model base = ds.getDefaultModel();
OntModel model = ModelFactory.createOntologyModel( spec, base );
model.read(sourceURL);

I have also tested this code with all previous version of apache-jena
including 2.10.0 and it works. But It fails in the latest one 2.10.1.

And then I compare jena 2.10.0 with 2.10.1 to find the differences of
the source file OntDocumentManager.java:

2.10.0:

...

if (getFileManager().getCachingModels() &&
...

return getFileManager().getCachingModels();
...

2.10.1:
...

if (getFileManager().isCachingModels() &&
...

return getFileManager().isCachingModels();
...

I think that the difference isn't the root cause, but I am not sure.

Would you please tell me why?

Thank you very much.

Deyan
---
Confidentiality Notice: The information contained in this e-mail and any 
accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential 
and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of 
this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, 
disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this 
communication in error,please 
immediately notify the sender by return e-mail, and delete the original message 
and all copies from 
your system. Thank you. 
---


How to load OntModel including imported sub-models to TDB?

2013-08-21 Thread Deyan Chen
Hi All,

I want to load an ontology file to persistent TDB store. The ontology
file imports other ontologies that are also located in the same local
directory. The code is as follows:

..
Dataset dataset = TDBFactory.assembleDataset(assemblerFile);
dataset.begin(ReadWrite.WRITE);
try {

Model base = dataset.getDefaultModel();
OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM,
base);

OntDocumentManager dm = model.getDocumentManager();
dm.setProcessImports(true);
dm.setCacheModels(true);

FileInputStream inputStream =
FileIOManager.getFileInputStream(inputFileName);
model.read(inputStream);

// Finally, commit the transaction.
dataset.commit();
} finally {
dataset.end();
}

Then I want to get a sub-model from the dataset,
..
Dataset dataset = TDBFactory.assembleDataset(assemblerFile);
dataset.begin(ReadWrite.READ);
try {

Model subModel = dataset.getNamedModel("http://...";);
Query query = QueryFactory.read(queryString);
QueryExecution qexec = QueryExecutionFactory.create(query, subModel);
try {
ResultSet results = qexec.execSelect();
ResultSetFormatter.out(results);
} finally {
qexec.close();
}
} finally {
dataset.end();
}

But the output is null. Can you tell me how to do?
Thank you very much.

Deyan
---
Confidentiality Notice: The information contained in this e-mail and any 
accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential 
and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of 
this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, 
disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this 
communication in error,please 
immediately notify the sender by return e-mail, and delete the original message 
and all copies from 
your system. Thank you. 
---