User jerven - Semantic Overflowmost recent 30 from http://www.semanticoverflow.com2010-03-21T04:21:06Zhttp://www.semanticoverflow.com/feeds/user/12http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://www.semanticoverflow.com/questions/595/owl-constaint-on-a-set-of-datatypesOWL constaint on a set of datatypes.Jerven2010-02-22T15:45:13Z2010-02-24T10:15:41Z
<p>Hi All,</p>
<p>I want to record that some data was published on a specific data e.g.</p>
<pre><code>a :published_in "2009-01-01"^^date ;
</code></pre>
<p>However, sometimes I only have a period in which it was published not a specific date.</p>
<pre><code> :published_in "P2009Y01M"^^duration .
</code></pre>
<p>Now in my OWL file I want to constrain :published_in to either one of these datatypes.
So I want to give it a Range. The usual approach for one datatype is:</p>
<pre><code><owl:DatatypeProperty rdf:about="published_in">
<rdfs:range rdf:resource="&xsd;date"/>
</owl:DatatypeProperty>
</code></pre>
<p>My first naive approach was:</p>
<pre><code><owl:DatatypeProperty rdf:about="published_in">
<rdfs:range rdf:resource="&xsd;date"/>
<rdfs:range rdf:resource="&xsd;duration"/>
</owl:DatatypeProperty>
</code></pre>
<p>This fails in pellet once data is introduced. (No literal can meet the restrictions of date and duration).</p>
<p>Two other approaches I tried were:</p>
<pre><code><owl:DatatypeProperty rdf:about="published_in">
<rdfs:range>
<owl:Class>
<rdf:Description>
<owl:unionOf rdf:parseType="Collection">
<rdf:type rdf:resource="&xsd;date"/>
<rdf:type rdf:resource="&xsd;duration"/>
</owl:unionOf>
</rdf:Description>
</owl:Class>
</rdfs:range>
</owl:DatatypeProperty>
</code></pre>
<p>This seems to work in Pellet but not in Protege (a random datatype is loaded as constraint in Protege instead of the unionOf).</p>
<p>The second approach I tried was</p>
<pre><code><owl:DatatypeProperty rdf:about="published_in">
<rdfs:range>
<rdf:Description>
<rdf:type rdf:resource="&owl;DataRange"/>
<owl:oneOf>
<rdf:Description>
<rdf:type rdf:resource="&owl;List"/>
<rdf:first rdf:datatype="&xsd;date"/>
<rdf:rest>
<rdf:Description>
<rdf:type rdf:resource="&owl;List"/>
<rdf:first rdf:datatype="&xsd;date"/>
<rdf:rest rdf:resource="&rdf;nil">
</rdf:Description>
</rdf:rest>
</rdf:Description>
</owl:oneOf>
</rdf:Description>
</rdfs:range>
</owl:DatatypeProperty>
</code></pre>
<p>This second approach does not work at all. It expects a <> empty element/literal with a datatype of either which is not at all that I want.</p>
<p>So in other words how do I correctly encode in OWL that :published_in is limit to the things that are a date or a duration?</p>
http://www.semanticoverflow.com/questions/516/generating-unique-ids-in-triple-store-ala-mysql-auto-increment/533#533Answer by Jerven for Generating unique ID's in triple-store, ala MySQL AUTO_INCREMENTJerven2010-02-03T08:22:47Z2010-02-03T08:22:47Z<p>When using virtuoso you can use the fact that it is also a rdbms to use its internal atomic sequences. With something like this.</p>
<pre><code>SPARQL INSERT INTO GRAPH <http://mygraph.com> {
<:a>
<:p>
sql:sequence_next("GRAPH_IDENTIFIER") };
</code></pre>
<p>See <a href="http://docs.openlinksw.com/virtuoso/sequenceobjects.html" rel="nofollow">http://docs.openlinksw.com/virtuoso/sequenceobjects.html</a>
and
<a href="http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsqlfromsparql" rel="nofollow">http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsqlfromsparql</a></p>
<p>To be honest I have not tested it yet. I will try this tonight. In practice you might need to do a separate select for key and then insert later as you might need the key directly in your front-end application.</p>
http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasonerSimple CLI useable OWL ReasonerJerven2009-11-10T16:27:40Z2009-11-19T04:18:48Z
<p>Hi All,</p>
<p>I am looking for a simple to use OWL reasoner.
e.g: preferably
reasoner -owl core.owl -rdf P05067.rdf
which will tell me if the small P05067.rdf file contradicts any rules in the core.owl
As well as show which triples are inferred. Preferably explaining which rules are the source of the contradiction and/or inference.</p>
<p>The use case is debugging and testing a owl or the rdf file for correctness. i.e. sometimes I want to check that the OWL file does not declare OWL legal inferences that are real world wrong. And at other times I want to check if an class instance in a RDF file does not contain contradiction.</p>
<p>Regards,</p>
<p>Jerven</p>
<p>e.g.</p>
<p>I want to check if
<a href="http://purl.uniprot.org/taxonomy/9606" rel="nofollow">http://purl.uniprot.org/taxonomy/9606</a>
meets the requirements of
<a href="ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/rdf/core.owl" rel="nofollow">ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/rdf/core.owl</a>
without adapting either file if at all possible.</p>
<p>For example an owl:restriction? e.g. one of the things <em>I think</em> I can say in OWL is that the species in the following example must be one of the Rank instances defined in the core.owl. Using <em>something like</em></p>
<p><code>
@base <a href="http://purl.uniprot.org/core/" rel="nofollow">http://purl.uniprot.org/core/</a> .<br/>
t a :Taxon<br/>
[ a owl:Restriction; <br/>
owl:onProperty t:rank <br/>
owl:allValuesFrom :Rank ] <br/></p>
<p>@base <a href="http://purl.uniprot.org/core/" rel="nofollow">http://purl.uniprot.org/core/</a> .<br/>
@prefix rdf:<a href="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rel="nofollow">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a> .<br/>
@prefix rdfs:<a href="http://www.w3.org/2000/01/rdf-schema#" rel="nofollow">http://www.w3.org/2000/01/rdf-schema#</a> .<br/>
@prefix owl:<a href="http://www.w3.org/2002/07/owl#" rel="nofollow">http://www.w3.org/2002/07/owl#</a> .<br/>
<a href="http://purl.uniprot.org/taxonomy/9606" rel="nofollow">http://purl.uniprot.org/taxonomy/9606</a>> rdf:type :Taxon ;<br/>
:rank :Species ;<br/>
</code></p>
<p>As well as cardinality restricitions etc...</p>
http://www.semanticoverflow.com/questions/11/isnt-the-semantic-web-overrated/12#12Answer by Jerven for Isn't the "Semantic Web" overrated?Jerven2009-10-27T16:03:27Z2009-10-27T16:03:27Z<p>First of all the semantic web is much bigger than the social web as captured in facebook and twitter etc... which are by the way technical solutions ;)</p>
<p>Taking the XING and Linkedin examples. Both use custom API's to provide limited views of their data to developers. They deal with similar data although in different markets. Both have an interest in limiting the link out of capability of their users. i.e. I can't add a XING user as a linkedin connection without forcing the XING user to create an all new linkedin profile.</p>
<p>The semantic web is about removing such barriers and enabling linking at convenience of the user not the provider. So in that sense it is as much a social innovation as a technical one.
Meaning more freedom to apply those social filters that you define in ways that are more interesting to you.</p>
<p>The nice thing is in application where there is no real social reason to put barriers we can reduce the cost of the technical ones by sharing our data in the semantic web. e.g. in the life sciences a common workflow is download data -> parse -> load in to database -> query -> answer.
In the semantic web that is reduced to download data -> load in to 3store -> query -> answer or in the idealistic semantic web query -> federate as required over data providers -> answer.
Lowering, these technical barriers using semantic web techniques means that users can spend more time on asking questions instead of enabling themselves to ask questions.</p>
<p>Therefore, while the concept is grandiose and does suffer from unneeded complexity in its implementation, the semantic web concept is underrated ;) </p>
http://www.semanticoverflow.com/questions/595/owl-constaint-on-a-set-of-datatypes/597#597Comment by JervenJerven2010-03-03T07:59:30Z2010-03-03T07:59:30ZThe answer that worked well is int the second suggestion. In the end I used the class that uses the property to have the restriction.http://www.semanticoverflow.com/questions/595/owl-constaint-on-a-set-of-datatypes/596#596Comment by JervenJerven2010-02-24T10:26:52Z2010-02-24T10:26:52ZThe restriction concept as defined here is correct. I want to say that if a literal is of the type date or duration then it could be a :published_in. And more importantly if the literal is not date or duration then it can not be a :published_in Thing. Meaning that if I write bla :published_in "123"^^int an OWL reasoner will tell me that the declared type of bla :published_in "123"^^int does not conform to the OWL definition of :published_inhttp://www.semanticoverflow.com/questions/595/owl-constaint-on-a-set-of-datatypes/597#597Comment by JervenJerven2010-02-24T10:16:41Z2010-02-24T10:16:41ZI do find it useful. The question here is not how to test/reason on the restriction but on how to encode it.http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/284#284Comment by JervenJerven2010-02-22T15:25:24Z2010-02-22T15:25:24ZPellet 2.0.1 does this. And has found quite a few errors in the owl file as well as the RDF files. that we produce.
./pellet.sh consistency "uri of owl" "uri of rdf"
http://www.semanticoverflow.com/questions/314/what-open-source-framework-can-autogenerate-html-for-sparql-output/315#315Comment by JervenJerven2009-12-04T08:55:48Z2009-12-04T08:55:48ZYou can select all date items in Xpath using /*[. instance of xsd:date] (from memory). And should thus be able to transform them with XSLThttp://www.semanticoverflow.com/questions/330/what-rights-do-and-dont-i-have-over-a-derivative-dataset-i-create/331#331Comment by JervenJerven2009-11-30T09:08:36Z2009-11-30T09:08:36Z@kwijibo I remember a court case in the Netherlands about a second provider of the Dutch telephone book (early 90's). Here a second party had send a bunch of phone-books to china to get a typed copy. They then used the copy to print more copies (or CD's for call-centers) The number of typos was cause for the Judge to declare that it was likely that all data was typed (with other evidence such as contracts with the chinese party work slips etc...)http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/310#310Comment by JervenJerven2009-11-23T08:22:53Z2009-11-23T08:22:53ZThe command line options do not quite do what I want but with the owl-api (<a href="http://owlapi.sourceforge.net/documentation.html" rel="nofollow">owlapi.sourceforge.net/documentation.html</a>) I think it will not be a lot of work to get what I want exactly.http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/252#252Comment by JervenJerven2009-11-11T09:11:31Z2009-11-11T09:11:31ZI will try to explain why I would prefer to have the instance data separate from owl definitions. I am trying to write a simple QA tool. In the UniProt release cycle there is limited time and hardware resources to do this. So I want to select a number of random entries and validate each of these separately. Preferably with as much debug information as possible when an instance conflicts with the OWL. If I can avoid merging the owl file with the rdf containing the instance data. I would strongly prefer so. However, I won't mind it if there is no other way.http://www.semanticoverflow.com/questions/235/simple-cli-useable-owl-reasoner/236#236Comment by JervenJerven2009-11-10T17:20:20Z2009-11-10T17:20:20ZPellet certainly seems interesting. However, I am still looking at how to make it reason using owl rules in one file and rdf data in the second.