[OTDev] Java Examples for Dataset Creation

chung chvng at mail.ntua.gr
Tue Dec 8 13:49:35 CET 2009


Hi Nina,
 At http://www.opentox.org/data/documents/development/RDF%
20files/AlgorithmTypes/view?searchterm=Algorithm%20Types%20ontology (the
ontology for all algorithm types we use in OT), all algorithm types,
appear to be Resources, not Literals. However in
http://www.opentox.org/data/documents/development/RDF%
20files/JavaOnly/JenaExamples , the object which answers the question:

<http://myservice.com/algorithm/id>
<http://www.opentox.org/api/1.1#isA> ?obj

is a literal. The corresponding triple is:

Subject: 
http://opentox.ntua.gr:3000/algorithm/mlr
Predicate:
http://www.opentox.org/api/1.1#isA 
Object:
"http://www.opentox.org/algorithmTypes.owl#RegressionEagerSingleTarget"

Is this correct? If yes, should we use literals in that case or
resources?

The same holds for the supported statistics. The java code snippet
produces an RDF which includes the triple:

http://opentox.ntua.gr:3000/algorithm/mlr
http://www.opentox.org/api/1.1#statisticsSupported
"statistics-1"^^http://www.w3.org/2001/XMLSchema#string

Shouldn't the object
("statistics-1"^^http://www.w3.org/2001/XMLSchema#string ) be a Resource
instead of a string? Was it a Resource, one assign propertied on it -
For example one could declare its type etc.

These phenomena do not appear in the RDF representation of a dataset
where most elements are Resources instead of Literals.

On Tue, 2009-12-08 at 13:45 +0200, Nina Jeliazkova wrote:
> Hi Pantelis,
> 
> In principle yes (the Class of the resource should be defined and this
> is done via RDFType), but there is already in the example
> 
> 	OT.OTClass.Dataset.createOntClass(jenaModel);
> 
> which does the same , if jenaModel is OntModel.

When I add this piece of code, the following triple is additionally
included in the representation:

* http://sth.com/dataset/1 
* http://www.w3.org/1999/02/22-rdf-syntax-ns#type
* http://www.opentox.org/api/1.1#Dataset

which is absent if
dataset.addRDFType(OT.OTClass.Dataset.createProperty(datasetModel)); is
not included. Otherwise the only triple present is this:

* http://www.opentox.org/api/1.1#Dataset
* http://www.w3.org/1999/02/22-rdf-syntax-ns#type
* http://www.w3.org/2002/07/owl#Class

which simply implies that Dataset is of type Class (this doesn't provide
information about the dataset itself, as an instance, but only for the
resource http://www.opentox.org/api/1.1#Dataset . So this way, we have
not defined that http://sth.com/dataset/1 is of type
http://www.opentox.org/api/1.1#Dataset which in turn is a Class.


Best Regards,
Pantelis

> 
> Regards,
> Nina
> chung wrote:
> > Hi Nina, 
> >  I think we have to include the following line in the code for the
> > creation of an RDF representation for datasets:
> >
> > dataset.addRDFType(OT.OTClass.Dataset.createProperty(datasetModel));
> >
> > This declares that the Resource under consideration is a Dataset.
> >
> > P.S. Thanks for the snippets!
> >
> > Best regards,
> > Pantelis
> >   
> 
> 





More information about the Development mailing list