performing validation. However, to make sure a se-
mantic DS remains consistent, a more powerful ap-
proach towards consistency checking is needed. This
is achieved by installing an OWL reasoner such as
Pellet (Sirin et al., 2007) between query engine and
DS which analyzes data before making it persistent.
4.4 Semantic Data Binding
A class or individual object is filled with data from the
DS by invoking its update function and data is sent
back to the DS by executing the commit function. For
performance reasons, we implemented these methods
in SemSon servlets deployed on a Web server which
have direct access to the DS. An update extracts data
from the DS using the resource’s URI as a reference
and maps this information on JSON as depicted in
figure 1. At the client-side script, the JSON data
is converted into an object and convenience methods
are added. A commit sends an object serialized into
JSON to the Web server where it is checked by a rea-
soner for consistency and finally added to the DS. We
also support an atomic commit operation in SemSon
using transactions. In a transaction, multiple individ-
ual objects can be grouped together and committed to
the DS in a single operation.
5 DISCUSSION AND
CONCLUSIONS
As a proof of concept, we have developed a prototype
Web application in which we use an OWL DL version
of the Friend of a Friend (FOAF) vocabulary to create
user profiles (see listing 1). The FOAF ontology
is imported into the DS and is preprocessed so that
OWL classes and individuals can be directly instanti-
ated using OOP. In this example, we use a transaction
to send the new and updated user profile to the DS
and verify the information was stored correctly using
a SPARQL query. When the ontology is extended
with constraints on properties which e.g. state that
each person must have a valid name, we can validate
individual objects at runtime. Furthermore, the Pellet
reasoner can be used to automatically infer missing
information when adding data to a DS. For example,
if FOAF is extended with family relations which
typically include inverse relations such as A parentOf
B ⇔ B childOf A, the reasoner can automatically
infer missing facts and add them to the DS to keep
ontologies and their instances consistent at all times.
We have presented a framework
3
for developing
3
http://research.edm.uhasselt.be/semson/
dynamic Web applications that can create and/or use
semantic data from within a Web browser. SemSon is
targeted toward programmers who are familiar with
JavaScript, but only have a basic understanding of
OWL and ontologies in general. Besides the FOAF
example, we have used SemSon to create a Web
interface for controlling a pervasive environment
described using different domain-specific ontologies.
For now, the DS is disadvantageous for the scalability
of our approach since it is a centralized component.
When facing large data sets (and associated complex
ontologies) it needs to be replaced by a distributed
storage and querying solution.
v a r f o a f n s =
’ h t t p : / / www. mindswap . o r g / 2 0 0 3 / owl / f o a f ’ ;
v a r f r i e n d = ’ h t t p : / / myns / m y f r iend ’ ;
semson . r e g i s t e r N S ( ’ f o a f ’ , f o a f n s ) ;
semson . i m p o r t ( f o a f n s , t r u e ) ;
/ / r e g i s t e r c l a s s o b j e c t s
v a r p1 = new f o a f . P e rs o n ( ) ;
/ / c r e a t e i n d i v i d u a l s
p1 . f i r s t N a m e = ’ f i r s t ’ ; p1 . s urname = ’ l a s t ’ ;
v a r p2 = new f o a f . P e rs o n ( f r i e n d ) ;
p1 . knows . push ( p2 . u r i ) ;
p2 . knows . push ( p1 . u r i ) ;
semson . commit ( p1 , p2 ) ; / / t r a n s a c t i o n
v a r q = ’SELECT ? p
WHERE {? p f o a f : knows <’+ f r i e n d + ’ > } ’;
v a r q r = semson . s e l e c t ( q ) ; / / q u e r y i n g
f o r ( b i n q r . r e s u l t s . b i n d i n g s )
i f ( q r . r e s u l t s . b i n d i n g s [ b ] . p . v a l u e
== p1 . u r i )
a l e r t ( ’ f o u n d ! ’ ) ;
Listing 1: Creating a FOAF user profile using SemSon.
REFERENCES
Berners-Lee, T., Hendler, J., and Lassila, O. (2001). The
Semantic Web. Scientific American, pages 34–43.
Clark, K. G., Feigenbaum, L., and Torres, E. (2007).
Serializing SPARQL Query Results in JSON.
http://www.w3.org/TR/rdf-sparql-json-res/.
Kalyanpur, A., Pastor, D. J., Battle, S., and Padget, J. A.
(2004). Automatic Mapping of OWL Ontologies into
Java. In SEKE’04, pages 98–103.
Koide, S. and Takeda, H. (2006). OWL-Full Reasoning
from an Object Oriented Perspective. In ASWC’06,
pages 263–277.
Prud’hommeaux, E. and Seaborne, A. (2008). SPARQL
Query Language for RDF. http://www.w3.org/TR/rdf-
sparql-query/.
Sirin, E., Parsia, B., Grau, B., Kalyanpur, A., and Katz, Y.
(2007). Pellet: A practical OWL-DL reasoner. Web
Semantics: Science, Services and Agents on the World
Wide Web, 5(2):51–53.
WEBIST 2010 - 6th International Conference on Web Information Systems and Technologies
166