


<owl:Class rdf:about="http://www.liyangyu.com/camera#ExpensiveDSLR_1">
<rdfs:subClassOf rdf:resource="http://www.liyangyu.com/camera#DSLR"/>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.liyangyu.com/camera#owned_by"/>
<owl:someValuesFrom rdf:resource="http://www.liyangyu.com/camera#Professional"/>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
Then we have an instance defined (p. 168) as follows.
<myCamera:ExpensiveDSLR_1 rdf:about="http://dbpedia.org/resource/Canon_EOS-1D_1">
<myCamera:owned_by rdf:resource="http://www.liyangyu.com/people#Tom"/>
</myCamera:ExpensiveDSLR_1>
The author claims then that following fact will be inferred.
<http://www.liyangyu.com/people#Tom> rdf:type <http://www.liyangyu.com/camera#Professional>
I checked this with Pellet and other reasoners but no one infers this.
The author forgets that we are working with an Open World Assumption. At any time someone else can come along with new information. So at this stage one is not certain that the only owner known is a Professional; hence no inference.
owl:someValuesFrom is used to infer subject from objects, not the other way around as the author claims.
<owl:Class rdf:about="http://www.liyangyu.com/camera#ExpensiveDSLR_2">The related instance:
<rdfs:subClassOf rdf:resource="http://www.liyangyu.com/camera#DSLR"/>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.liyangyu.com/camera#cost"/>
<owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>expensive</owl:hasValue>
</owl:Restriction>
</rdfs:subClassOf>
</owl:Class>
<myCamera:DSLR rdf:about="http://dbpedia.org/resource/Canon_EOS-1D_2">
<myCamera:owned_by rdf:resource="http://www.liyangyu.com/people#Tom"/>
<myCamera:cost rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>expensive</myCamera:cost>
</myCamera:DSLR>
The claimed inference:
<http://dbpedia.org/resource/Canon_EOS-1D_2> rdf:type <http://www.liyangyu.com/camera#ExpensiveDSLR_2>
Again checking this with Pellet et all: no inference at all.
This is because the condition in the model is as follows:
| If | then |
|---|---|
| instance of http://www.liyangyu.com/camera#ExpensiveDSLR_2 | property cost has value "expensive". |
Not the way around.
If you change the model to
<owl:Class rdf:about="http://www.liyangyu.com/camera#ExpensiveDSLR_3">
<rdfs:subClassOf rdf:resource="http://www.liyangyu.com/camera#DSLR"/>
<owl:equivalentClass>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.liyangyu.com/camera#cost"/>
<owl:hasValue rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>expensive</owl:hasValue>
</owl:Restriction>
</owl:equivalentClass>
</owl:Class>
then you get
| If | then |
|---|---|
| instance of http://www.liyangyu.com/camera#ExpensiveDSLR_3 | property cost has value "expensive". |
| AND | |
| property cost has value "expensive" | instance of http://www.liyangyu.com/camera#ExpensiveDSLR_3 |

| Installing | This commercial version comes with an installer. The installation is exhaustively described in the Installation Guide and should complete without any trouble. However there seems to be an incompatibility between windows 7 (32-bit) and the included PHP related dll which was solved by commenting out the last line in the virtuoso.ini file. ;Load10=Hosting, hosting_php.dllAfter installation, you need to run the Virtuoso Service Manager and start the Virtuoso server. Your server can be accessed then from http://localhost:8890/ |
| Populating | The manual describes 13 !!! different methods to insert RDF into Virtuoso. Didn't test them all, but not all seem to work with the 168.871 KB file I used. So I describe only what worked for me. What worked for mefor files on the filesystem
for files on a http server
|
Virtuoso Service Manager
Virtuoso Server

Virtuoso Web Server
Everyone can crawl then the datasets of interest,

| Installing | Installing of Joseki is easy; just follow the instructions at http://www.joseki.org/start.html. |
| Creating and populating the TDB triple store | I took a shortcut here using Topbraid Composer ME, which has an export facility to TDB and saves the database as a folder to the file system with extension '.tdb.data' (see screenshot). |
| Connecting Joseki with TDB | This is the hard stuff. The trick lies in adapting the Joseki configuration file ('joseki-config.ttl'). I added an additional service: # Service 3 - SPARQL processor handling a TDB dataset and an additional corresponding dataset: ## Initialize TDB. One also needs to adapt the 'web.xml' file in the webapps/joseki/WEB-INF folder by adding: <servlet-mapping> Then I made a specific HTML page that contains following form where the action is sent to the TDB service: <form action="TDB" method="get"> |
| Overall | This took some considerable time to figure out. |
| installing | Same as above; just follow the instructions at http://www.joseki.org/start.html. |
| creating and populating a BigOWLIM triple store | I used the Sesame console application, using the BigOWLIM repository template file 'bigowlim.ttl' to be copied in the templates directory of the OpenRDF Sesame console folder. On Windows 7 this is C:\Users\xxx\Appdata\Roaming\Aduna\OpenRDF Sesame console\templates. See the BigOWLIM Quick Start Guide (PDF). Populating the repository can then be done using the Sesame web app. |
| connecting Joseki with the BigOWLIM triple store | Similar actions as above. Editing the joseki configuration file. a) adding a service # Service 4 - SPARQL processor handling a BigOWLIM storeb) adding a dataset ## Initialize BigOWLIMEditing then web.xml file by adding. <servlet-mapping>And brewing a HTML file that posts a SPARQL query to the BigOWLIM service (same as above). |
| Installing | is straight forward; copying two war files in a Java servlet container as described in the manual at http://www.openrdf.org/doc/sesame2/2.3.2/users/userguide.html#chapter-server-install brings you up and running in no time. |
| Creating a store | created the test triple store using the openrdf-workbench web app ('New repository' under 'Repositories'). BEWARE:With my testfile of 168 Mb using the 'In Memory Store' did lead to a Java Heap Space issue; did choose a 'Native Java Store' instead. |
| Populating the store | using the 'Add' directive under 'Modify' of the open-rdf workbench. |
| Overall | very easy to set up with a very good web management interface. |
| installing | the Sesame part is identical as above. for the BigOWLIM part; the BigOWLIM Quick Start Guide (PDF) has a very good step by step procedure. BEWARE: if you want additional functionality such as geo queries, you best copy all the jars from the bigowlim-3.4\ext folder to the openrdf-sesame\WEB-INF\lib folder instead of only the 4 jars mentioned in the guide. |
| creating a triple store | this cannot be done from the sesame openrdf-workbench. You need to use the Sesame console application, using the BigOWLIM repository template file 'bigowlim.ttl' to be copied in the templates directory of the OpenRDF Sesame console folder. On Windows 7 this is C:\Users\xxx\Appdata\Roaming\Aduna\OpenRDF Sesame console\templates. This is again well described in the same Quick Start Guide. |
| populating the triple store | once the repository is created one can populate it using the openrdf workbench (same as above). |
| overall | a little bit more tricky, but once the store is created, you have the same user-friendly environment as with plain Sesame. |
SELECT DISTINCT ?name (count( ?person) as ?total )
WHERE {
?person kennedys:gender ?gender.
?gender rdfs:label ?name.
}
GROUP BY ?name
ORDER BY desc(?total)
which gives following result:
| Product | RDF file loaded | support documented | SPARQL aggregate working |
|---|---|---|---|
| Sesame/native store | yes | yes since version Sesame 2.4.0 | yes |
| Sesame/BigOWLIM | yes | yes since version 4.0 | yes |
| Joseki/ARQ/TDB | yes | yes | yes |
| Joseki/ARQ/bigOWLIM | yes | yes | yes |
| Virtuoso | yes | yes | yes |
| 4store | yes | not found | gives wrong result |
| Allegrograph | yes | not found | gives syntax error |
| Talis Platform | yes | yes | yes |

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:c="http://www.w3.org/ns/xproc-step"
xmlns:cx="http://xmlcalabash.com/ns/extensions"
name="myPipeline"
version="1.0">
<p:output
port="result"
sequence="true" />
<!-- path to the folder with rdf files -->The query in the Talis platform:
<p:variable
name="path"
select="'/Users/paul/Desktop/RandD/owlimimport/erfgoedplusImport/'">
<p:empty />
</p:variable>
<p:directory-list
include-filter=".*\.rdf">
<p:with-option
name="path"
select="$path">
<p:empty />
</p:with-option>
</p:directory-list>
<p:for-each
name="directoryloop">
<p:output
port="result"
sequence="true" />
<p:iteration-source
select="/c:directory/c:file" />
<p:variable
name="file"
select="concat($path,/c:file/@name)" />
<p:load
name="file">
<p:with-option
name="href"
select="$file" />
</p:load>
<p:insert
match="/c:request/c:body"
position="first-child">
<p:input
port="source">
<p:inline>
<c:request
href="http://api.talis.com/stores/zzzzzzzzz/meta"
method="POST"
detailed="true" auth-method="digest" username="xxxxxxx" password="yyyyyyy">
<c:body
content-type="application/rdf+xml" />
</c:request>
</p:inline>
</p:input>
<p:input
port="insertion">
<p:pipe
port="result"
step="file" />
</p:input>
</p:insert>
<p:http-request
name="request"/>
<p:identity />
</p:for-each>
</p:declare-step>
<x> pcce:city "Brussels"
<x> pcce:city "Brussels"^^xsd:string
My aim was to get rid of one of the two.
My initial idea was to make use of the SPARQL "datatype" operator, which returns the datatype IRI of the value.
My first SPARQL UPDATE query looked as follows:
DELETE {?a pcce:city ?city.}
WHERE {
?a a pcce:Building.
?a pcce:city ?city.
FILTER (datatype(?city) != xsd:string)
}
To my big surprise this didn't work at all.
I was kindly refered to the SPARQL spec by Scott Henninger of TopQuadrant, where is clearly indicated that if the parameter of the datatype operator is a simple literal, xsd:string is returned.
The built-in datatype operand in SPARQL casts untyped literals to xsd:string, so in both the cases xsd:string is returned making it impossible to check untyped literals this way.
DELETE {?a pcce:city ?city.}
WHERE {
?a a pcce:Building.
?a pcce:city ?city.
FILTER (sameTerm(?city,xsd:string(?city)))
}
Users of products from the TopBraid Suite family have access to a shortcut function for testing untyped literals: "spl:isUntypedLiteral".
Our query becomes then:
DELETE {?a pcce:city ?city.}
WHERE {
?a a pcce:Building.
?a pcce:city ?city.
FILTER (!spl:isUntypedLiteral(?city))
}
| SKOS Constraint | SPIN SPARQL | OWL2IC SPARQL (1) |
|---|---|---|
| S13 skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties |
# Constraint S13a: skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties. ASK WHERE { ?this skos:prefLabel ?label . ?this skos:altLabel ?label . } # Constraint S13b: skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties. ASK WHERE { ?this skos:prefLabel ?label . ?this skos:hiddenLabel ?label . } # Constraint S13c: skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties. ASK WHERE { ?this skos:hiddenLabel ?label . ?this skos:altLabel ?label . } |
Validating constraint: disjointProperties prefLabel altLabel hiddenLabel SELECT ?x0 WHERE { ?x0 skos:altLabel ?x1 ; skos:prefLabel ?x1 . } SELECT ?x0 WHERE { ?x0 skos:prefLabel ?x1 ; skos:hiddenLabel ?x1 . } GENERATED FROM OWL axiom [] a owl:AllDisjointProperties ; owl:members (skos:prefLabel skos:altLabel skos:hiddenLabel) . |
| S14 A resource has no more than one value of skos:prefLabel per language tag |
# Constraint S14: a resource has no more than one value of skos:prefLabel per language tag. ASK WHERE { ?this skos:prefLabel ?label1 . ?this skos:prefLabel ?label2 . LET (?label1lang := lang(?label1)) . LET (?label2lang := lang(?label2)) . FILTER ((?label1lang = ?label2lang) && (?label1 != ?label2)) . } |
# This condition cannot be encoded as a OWL integrity constraint directly. |
| S27 skos:related is disjoint with the property skos:broaderTransitive |
# Constraint S27: skos:related is disjoint with the property skos:broaderTransitive. ASK WHERE { ?this skos:related ?object1 . ?this skos:broaderTransitive ?object2 . FILTER (?object1 = ?object2) . } |
Validating constraint: related disjointPropertyWith broaderTransitive SELECT ?x0 WHERE { ?x1 owl:bottomObjectProperty ?x0 ; skos:related ?x0 . } GENERATED FROM OWL axiom skos:related owl:propertyDisjointWith skos:broaderTransitive . |
| S46 skos:exactMatch owl:propertyDisjointWith skos:broadMatch , skos:relatedMatch |
# Constraint S46: skos:exactMatch is disjoint with each of the properties skos:broadMatch and skos:relatedMatch. ASK WHERE { ?this skos:exactMatch ?exactMatch . OPTIONAL { ?this skos:broadMatch ?broadMatch . } . OPTIONAL { ?this skos:relatedMatch ?relatedMatch . } . FILTER ((?exactMatch = ?broadMatch) || (?exactMatch = ?relatedMatch)) . } |
Validating constraint: exactMatch disjointPropertyWith relatedMatch SELECT ?x0 WHERE { ?x1 skos:relatedMatch ?x0 ; skos:exactMatch ?x0 . } SELECT ?x0 WHERE { ?x1 skos:exactMatch ?x0 ; skos:broadMatch ?x0 . } GENERATED FROM OWL axiom skos:exactMatch owl:propertyDisjointWith skos:broadMatch , skos:relatedMatch . |
Make sure you see the videos at http://code.google.com/p/freebase-gridworks/
Some tricks I want to remember for myself:
+ followed by the country code: e.g. +32
followed by the area code with the 0 between parentheses: e.g. (0)15
followed by the local code following this pattern X?XX XX XX: e.g. 23 45 67
Full example: +32 (0)15 23 45 67
The existing dataset contains slightly different phone numbers; shown as loaded into Gridworks.

Using regular expressions we can split the existing numbers in 2 groups using parentheses to indicate the groups:
(^\+\d{2}\s)(\d{1,2}\s\d+\s\d{2}\s\d{2}$)The regular expression as shown in the RX Toolkit of Komodo IDE.
![]()
Now using these groups to replace the existing values with a value conforming the wished structure using the replacement expression
group 1 followed by '(0) followed by group 2.
\1(0)\2
![]()
Now that we have our regex working, let's move on to Gridworks now.
On the column containing the telephone numbers, choose Edit cells, Transform ...
![]()
Now we can use the Gridworks expression language (GEL) to do our transform.
GEL offers a whole list of functions; we will be using 'replace'. 'Replace' takes 3 arguments:
replace(value,//,'')
where value refers to the value in the cell
where // delimits the regex
and '' contains the replacement string using the captured groups being indicated with '$', e.g. $1, $2.
In our case the expression became:
replace(value,/(^\+\d{2}\s)(\d{1,2}\s\d+\s\d{2}\s\d{2}$)/,'$1(0)$2')


forNonBlank(e, v, eNonBlank, eBlank)
In our case
forNonBlank(value, v, 'not relevant', 'museum')
Update: See similar post of Ric Roberts: Installing Jena, Joseki and TDB on OS X or Linux
SELECT COUNT(?person) AS ?alicesSPARQL 1.1 however is not (yet?) supported in Sesame.
WHERE {
?person :name "Alice" .
}
# Service 3 - SPARQL processor only handling a given dataset
<#service3>
rdf:type joseki:Service ;
rdfs:label "SPARQL on TDB" ;
joseki:serviceRef "TDB" ;
# web.xml must route this name to Joseki
# dataset part
joseki:dataset <#newdata> ;
# Service part.
# This processor will not allow either the protocol,
# nor the query, to specify the dataset.
joseki:processor joseki:ProcessorSPARQL_FixedDS ;
and the settings for the 'newdata' dataset.
## Initialize TDB.
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
<#newdata> rdf:type tdb:DatasetTDB ;
rdfs:label "A new TDB dataset" ;
tdb:location "C:/Users/Paul/MyWorkSpaces/TBCMEWorkspace/Test/kennedys.tdb.data" .
<servlet-mapping>
<servlet-name>SPARQL service processor</servlet-name>
<url-pattern>/TDB</url-pattern>
</servlet-mapping>
<form action="TDB" method="get">
<p>SELECT - get variables (apply XSLT stylesheet)</p>
<p><textarea name="query" cols="70" rows="5">
PREFIX kennedys: <http://topbraid.org/examples/kennedys#>
SELECT ?a ?c
WHERE
{ ?a kennedys:name ?c}</textarea>
<br/>
Output XML: <input type="radio" name="output" value="xml" checked/>
with XSLT style sheet (leave blank for none):
<input name="stylesheet" size="25" value="/xml-to-html.xsl" /> <br/>
or JSON output: <input type="radio" name="output" value="json"/> <br/>
or text output: <input type="radio" name="output" value="text"/> <br/>
or CSV output: <input type="radio" name="output" value="csv"/> <br/>
or TSV output: <input type="radio" name="output" value="tsv"/> <br/>
Force the accept header to <tt>text/plain</tt> regardless
<input type="checkbox" name="force-accept" value="text/plain"/>
<br/>
<input type="submit" value="Get Results" />
</p>
</form>
| SKOS | Constraint | SPIN | OWL2 | OWL2IC |
|---|---|---|---|---|
| S14 | Y | + | - | - |
| S13 | Y | + | - | + |
| S27 | Y | + | - | + |
| S55 | N | + | - | - |
If an ontology has an ontology IRI but no version IRI, then a different ontology with the same ontology IRI but no version IRI should not exist.However skos has two distinct ontologies with the same name."
SubObjectPropertyOf( ObjectPropertyChain( OPE1 ... OPEn ) OPE ).This axiom states that, if an individual x is connected with an individual y by a sequence of object property expressions OPE1, ..., OPEn ,
skos:prefLabel rdf:type owl:AnnotationProperty.
xl:prefLabel rdf:type owl:ObjectProperty.
xl:literalForm rdf:type owl:DatatypeProperty.
skos:prefLabel owl:propertyChainAxiom (Pellet 2.1.0 throws as expected a warning:
xl:prefLabel
xl:literalForm
).
WARNING: Unsupported axiom: Bnode in owl:propertyChainAxiom axiom is not a validConclusion: this type of property chaining cannot be done in OWL2.
property expression.
CONSTRUCT {
?this skos:prefLabel ?label .
}
WHERE {
?this xl:prefLabel ?prefLabel .
?prefLabel xl:literalForm ?label .
}The result as shown in TopBraid Composer:S27 skos:related is disjoint with the property skos:broaderTransitive.
<rdf:Property rdf:about="http://www.w3.org/2004/02/skos/core#related">
<rdfs:comment xml:lang="en">skos:related is disjoint with skos:broaderTransitive</rdfs:comment>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#SymmetricProperty"/>
<rdfs:subPropertyOf rdf:resource="http://www.w3.org/2004/02/skos/core#semanticRelation"/>
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
<skos:definition xml:lang="en">Relates a concept to a concept with which there is an associative semantic relationship.</skos:definition>
<rdfs:isDefinedBy rdf:resource="http://www.w3.org/2004/02/skos/core"/>
<rdfs:label xml:lang="en">has related</rdfs:label>
<owl:propertyDisjointWith rdf:resource="http://www.w3.org/2004/02/skos/core#broaderTransitive"/>
</rdf:Property>
OWL2 DL does put however, for the reasons of decidability, some restrictions on the use of the DisjointObjectProperties axiom. The properties used need to be simple, meaning very roughly that axioms of following form cannot be involved (directly or indirectly):
Indeed when using Pellet 2.0.2, we get following warning:
WARNING: Unsupported axiom:
Ignoring transitivity and/or complex subproperty axioms for broaderTransitive
31-mrt-2010 14:09:54 org.mindswap.pellet.RBox ignoreTransitivity
ASK WHERE {
?this skos:related ?object1 .
?this skos:broaderTransitive ?object2 .
FILTER (?object1 = ?object2) .
}
Throwing errors as indicated in TopBraid Composer with following example:
<rdf:Description rdf:about="http://www.w3.org/2004/02/skos/core#related">
<owl:propertyDisjointWith rdf:resource="http://www.w3.org/2004/02/skos/core#broaderTransitive"/>
</rdf:Description>
<rdf:Description rdf:about="http://www.w3.org/2004/02/skos/core#broaderTransitive">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#TransitiveProperty"/>
</rdf:Description>
reports correctly the constraint violation:
c:\Program Files\pellet-2.1.0>pellet-ic --constraints C:\Users\Paul\TBCMEWorkspa
ce\test\s27c.rdf C:\Users\Paul\TBCMEWorkspace\Test\s27.rdf
15-apr-2010 12:43:41 org.mindswap.pellet.jena.graph.loader.DefaultGraphLoader ad
dUnsupportedFeature
WARNING: Unsupported axiom: Ignoring transitivity axiom due to an existing disjo
intness axioms for property broaderTransitive
15-apr-2010 12:43:41 org.mindswap.pellet.RBox ignoreTransitivity
WARNING: Unsupported axiom: Ignoring transitivity and/or complex subproperty axi
oms for broaderTransitive
Validating 2 integrity constraints
Will stop after 1 constraint violation(s) are found
Validating constraint: related disjointPropertyWith broaderTransitive
Constraint violated : Yes
Violating individuals (1): Concept_1,
Number of constraint(s) violated: 1
FYI: the SPARQL Query generated by Pellet ICV from the OWL Axiom above is:
SELECT ?x0
WHERE
{ ?x1 skos:related ?x0 ;
skos:broaderTransitive ?x0 .
}
Once again fairly easy to do with SPIN;
a long study of the particularities of OWL2 DL restrictions to find out that this constraint cannot be expressed in OWL2 DL,
but OWL IC using the closed world assumption does the job also with 1 line of code.