[solved] User defined datatypes not working in OWL 1.X
I seemingly ran into the trouble that user-defined datatypes does not work in OWL 1.X (which is seemingly what the version of Pellet used in Bioclipse does support? TODO: CHECK).
The problem was manifested when trying to do arithmetic operations on the values (like filtering) in a SPARQL query.
So, the following SPARQL query would work:
PREFIX onto: <http://www.nmrshiftdb.org/onto#>
SELECT distinct ?shift
WHERE {
?peak onto:hasShift ?shift .
} LIMIT 10...but not this one:
PREFIX onto: <http://www.nmrshiftdb.org/onto#>
SELECT distinct ?shift
WHERE {
?peak onto:hasShift ?shift .
FILTER ( ?shift > 12.2 && ?shift < 12.8 ) .
} LIMIT 10I tried defnining the custom datatype by the means of the following file (NMRDatatypes.owl):
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="nmr:ppm">
<xsd:restriction base="xsd:double">
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>But, when trying to read this file into Pellet, with the following Bioclipse script:
rdf.importFile(myStore, "runningbioclipse/NMRDatatypes.xsd", "RDF/XML");...I get the following error:
Running JavaScript...
org.mozilla.javascript.WrappedException: Wrapped java.lang.RuntimeException: Failed to run method (line: #9)
java.lang.NullPointerException:
JavaScript done.The same problem seems to be reported here.
More external links
- http://lists.owldl.com/pipermail/pellet-users/2007-February/001225.html
- http://lists.mindswap.org/pipermail/owl/2006-June/000327.html
- http://dret.net/biblio/reference/swbpxschdatatypes
Suggestion ...
Maybe these ones solve it all:
- http://lists.owldl.com/pipermail/pellet-users/2009-July/003721.html
- http://clark-parsia.trac.cvsdude.com/pellet-devel/ticket/253
- http://www.semanticoverflow.com/questions/229/how-to-define-a-own-notation-datatype
Update: Problem solved
The problem was solved with the help of a message on the pellet-users mailing list. The problem was partly with an inconsistent combination of pellet and arq (Jena SPARQL package), and partly that namespaces can't be used in atttribute values, which was the case in the nmr-data, so it works after substituting:
<nmr:hasShift rdf:datatype="xsd:decimal"></nmr:hasShift>...with:
<nmr:hasShift rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal"></nmr:hasShift>(or in fact, we were using
<nmr:hasShift rdf:datatype="nmr:ppm"></nmr:hasShift>, but that didn't work eventhough expanding to the full URI, http://www.nmrshiftdb.org/onto#).
Comments
respond this topic
One understands that humen's life seems to be high priced, but different people require money for various things and not every one earns enough cash. Thence to get some <a href="http://lowest-rate-loans.com/topics/credit-loans">credit loans</a> or just collateral loan will be a right way out.