blob: 53c57e71768c0fc5a0fc471ab4989196a8361e20 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="SMILA/Documentation/SesameOntologyManager" />
<link rel="shortcut icon" href="http://wiki.eclipse.org/SMILA/Documentation/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="http://wiki.eclipse.org/opensearch_desc.php" title="Eclipsepedia (English)" />
<link rel="alternate" type="application/rss+xml" title="Eclipsepedia RSS Feed" href="http://wiki.eclipse.org/index.php?title=Special:Recentchanges&amp;feed=rss" />
<link rel="alternate" type="application/atom+xml" title="Eclipsepedia Atom Feed" href="http://wiki.eclipse.org/index.php?title=Special:Recentchanges&amp;feed=atom" />
<title>SMILA/Documentation/SesameOntologyManager - Eclipsepedia</title>
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "http://wiki.eclipse.org/skins/eclipsenova/novaWide.css?116"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="http://wiki.eclipse.org/skins/eclipsenova/eclipsenovaPrint.css?116" />
<link rel="stylesheet" type="text/css" media="handheld" href="http://wiki.eclipse.org/skins/eclipsenova/handheld.css?116" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/Nova/css/header.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/tabs.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/Nova/css/visual.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/Nova/css/layout.css" media="screen" />
<link rel="stylesheet" type="text/css" href="http://wiki.eclipse.org/skins/eclipsenova/Nova/css/footer.css" media="screen" />
<!--[if IE]><link rel="stylesheet" type="text/css" href="/skins/eclipsenova/IEpngfix.css" media="screen" /><![endif]-->
<!--[if lt IE 5.5000]><style type="text/css">@import "/skins/eclipsenova/IE50Fixes.css?116";</style> <![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "/skins/eclipsenova/IE55Fixes.css?116";</style><![endif]-->
<!--[if IE 6]><style type="text/css">@import "/skins/eclipsenova/IE60Fixes.css?116";</style><![endif]-->
<!--[if IE 7]><style type="text/css">@import "/skins/eclipsenova/IE70Fixes.css?116";</style><![endif]-->
<!--[if lt IE 7]><script type="text/javascript" src="/skins/common/IEFixes.js?116"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script type= "text/javascript">/*<![CDATA[*/
var skin = "eclipsenova";
var stylepath = "/skins";
var wgArticlePath = "/$1";
var wgScriptPath = "";
var wgScript = "/index.php";
var wgServer = "http://wiki.eclipse.org";
var wgCanonicalNamespace = "";
var wgCanonicalSpecialPageName = false;
var wgNamespaceNumber = 0;
var wgPageName = "SMILA/Documentation/SesameOntologyManager";
var wgTitle = "SMILA/Documentation/SesameOntologyManager";
var wgAction = "view";
var wgRestrictionEdit = [];
var wgRestrictionMove = [];
var wgArticleId = "18404";
var wgIsArticle = true;
var wgUserName = null;
var wgUserGroups = null;
var wgUserLanguage = "en";
var wgContentLanguage = "en";
var wgBreakFrames = false;
var wgCurRevisionId = "285845";
var wgVersion = "1.12.0";
var wgEnableAPI = true;
var wgEnableWriteAPI = false;
/*]]>*/</script>
<script type="text/javascript" src="http://wiki.eclipse.org/skins/common/wikibits.js?116"><!-- wikibits js --></script>
<!-- Performance mods similar to those for bug 166401 -->
<script type="text/javascript" src="http://wiki.eclipse.org/index.php?title=-&amp;action=raw&amp;gen=js&amp;useskin=eclipsenova"><!-- site js --></script>
<!-- Head Scripts -->
<script type="text/javascript" src="http://wiki.eclipse.org/skins/common/ajax.js?116"></script>
<style type="text/css">/*<![CDATA[*/
.source-xml {line-height: normal; font-size: medium;}
.source-xml li {line-height: normal;}
/**
* GeSHi Dynamically Generated Stylesheet
* --------------------------------------
* Dynamically generated stylesheet for xml
* CSS class: source-xml, CSS id:
* GeSHi (C) 2004 - 2007 Nigel McNie (http://qbnz.com/highlighter)
*/
.source-xml .de1, .source-xml .de2 {font-family: 'Courier New', Courier, monospace; font-weight: normal;}
.source-xml {}
.source-xml .head {}
.source-xml .foot {}
.source-xml .imp {font-weight: bold; color: red;}
.source-xml .ln-xtra {color: #cc0; background-color: #ffc;}
.source-xml li {font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;}
.source-xml li.li2 {font-weight: bold;}
.source-xml .coMULTI {color: #808080; font-style: italic;}
.source-xml .es0 {color: #000099; font-weight: bold;}
.source-xml .br0 {color: #66cc66;}
.source-xml .st0 {color: #ff0000;}
.source-xml .nu0 {color: #cc66cc;}
.source-xml .sc0 {color: #00bbdd;}
.source-xml .sc1 {color: #ddbb00;}
.source-xml .sc2 {color: #339933;}
.source-xml .sc3 {color: #009900;}
.source-xml .re0 {color: #000066;}
.source-xml .re1 {font-weight: bold; color: black;}
.source-xml .re2 {font-weight: bold; color: black;}
/*]]>*/
</style>
<style type="text/css">/*<![CDATA[*/
@import "http://wiki.eclipse.org/index.php?title=MediaWiki:Geshi.css&usemsgcache=yes&action=raw&ctype=text/css&smaxage=18000";
/*]]>*/
</style><link rel="stylesheet" type="text/css" href="SesameOntologyManager.html" /> </head>
<body class="mediawiki ns-0 ltr page-SMILA_Documentation_SesameOntologyManager">
<div id="globalWrapper">
<div id="column-one">
<!-- Eclipse Additions for the Top Nav start here M. Ward-->
<div id="header">
<div id="header-graphic">
<img src="http://wiki.eclipse.org/skins/eclipsenova/eclipse.png" alt="Eclipse Wiki">
</div>
<!-- Pulled 101409 Mward -->
<div class="portlet" id="p-personal">
<div class="pBody">
<ul>
<li id="pt-login"><a href="http://wiki.eclipse.org/index.php?title=Special:Userlogin&amp;returnto=SMILA/Documentation/SesameOntologyManager">Log in</a></li>
</ul>
</div>
</div>
<div id="header-icons">
<div id="sites">
<ul id="sitesUL">
<li><a href="http://www.eclipse.org"><img src="http://dev.eclipse.org/custom_icons/eclipseIcon.png" width="28" height="28" alt="Eclipse Foundation" title="Eclipse Foundation" /><div>Eclipse Foundation</div></a></li>
<li><a href="http://marketplace.eclipse.org"><img src="http://dev.eclipse.org/custom_icons/marketplace.png" width="28" height="28" alt="Eclipse Marketplace" title="Eclipse Marketplace" /><div>Eclipse Marketplace</div></a></li>
<li><a href="https://bugs.eclipse.org/bugs"><img src="http://dev.eclipse.org/custom_icons/system-search-bw.png" width="28" height="28" alt="Bugzilla" title="Bugzilla" /><div>Bugzilla</div></a></li>
<li><a href="http://live.eclipse.org"><img src="http://dev.eclipse.org/custom_icons/audio-input-microphone-bw.png" width="28" height="28" alt="Live" title="Live" /><div>Eclipse Live</div></a></li>
<li><a href="http://planeteclipse.org"><img src="http://dev.eclipse.org/large_icons/devices/audio-card.png" width="28" height="28" alt="PlanetEclipse" title="Planet" /><div>Planet Eclipse</div></a></li>
<li><a href="http://portal.eclipse.org"><img src="http://dev.eclipse.org/custom_icons/preferences-system-network-proxy-bw.png" width="28" height="28" alt="Portal" title="Portal" /><div>My Foundation Portal</div></a></li>
</ul>
</div>
</div>
</div>
<!-- NEW HEADER STUFF HERE -->
<div id="header-menu">
<div id="header-nav">
<ul> <li><a class="first_one" href="http://wiki.eclipse.org/" target="_self">Home</a></li> <li><a href="http://www.eclipse.org/downloads/" target="_self">Downloads</a></li>
<li><a href="http://www.eclipse.org/users/" target="_self">Users</a></li>
<li><a href="http://www.eclipse.org/membership/" target="_self">Members</a></li>
<li><a href="http://wiki.eclipse.org/index.php/Development_Resources" target="_self">Committers</a></li>
<li><a href="http://www.eclipse.org/resources/" target="_self">Resources</a></li>
<li><a href="http://www.eclipse.org/projects/" target="_self">Projects</a></li>
<li><a href="http://www.eclipse.org/org/" target="_self">About Us</a></li>
</ul>
</div>
<div id="header-utils">
<!-- moved the search window here -->
<form action="http://wiki.eclipse.org/Special:Search" >
<input class="input" name="search" type="text" accesskey="f" value="" />
<input type='submit' onclick="this.submit();" name="go" id="searchGoButton" class="button" title="Go to a page with this exact name if one exists" value="Go" />&nbsp;
<input type='submit' onclick="this.submit();" name="fulltext" class="button" id="mw-searchButton" title="Search Eclipsepedia for this text" value="Search" />
</form>
</div>
</div>
<!-- Eclipse Additions for the Header stop here -->
<!-- Additions and mods for leftside nav Start here -->
<!--Started nav rip here-->
<!-- these are the nav controls main page, changes etc -->
<div id="novaContent" class="faux">
<div id="leftcol">
<ul id="leftnav">
<!-- these are the page controls, edit history etc -->
<li class="separator"><a class="separator">Navigation &#160;&#160;</li>
<li id="n-mainpage"><a href="http://wiki.eclipse.org/Main_Page">Main Page</a></li>
<li id="n-portal"><a href="http://wiki.eclipse.org/Eclipsepedia:Community_Portal">Community portal</a></li>
<li id="n-currentevents"><a href="http://wiki.eclipse.org/Eclipsepedia:Current_events">Current events</a></li>
<li id="n-recentchanges"><a href="http://wiki.eclipse.org/Special:Recentchanges">Recent changes</a></li>
<li id="n-randompage"><a href="http://wiki.eclipse.org/Special:Random">Random page</a></li>
<li id="n-help"><a href="http://wiki.eclipse.org/Help:Contents">Help</a></li>
<li class="separator"><a class="separator">Toolbox &#160;&#160;</a></li>
<li id="t-whatlinkshere"><a href="http://wiki.eclipse.org/Special:Whatlinkshere/SMILA/Documentation/SesameOntologyManager">What links here</a></li>
<li id="t-recentchangeslinked"><a href="http://wiki.eclipse.org/Special:Recentchangeslinked/SMILA/Documentation/SesameOntologyManager">Related changes</a></li>
<!-- This is the toolbox section -->
<li id="t-upload"><a href="http://wiki.eclipse.org/Special:Upload">Upload file</a></li>
<li id="t-specialpages"><a href="http://wiki.eclipse.org/Special:Specialpages">Special pages</a></li>
<li id="t-print"><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/SesameOntologyManager&amp;printable=yes">Printable version</a></li> <li id="t-permalink"><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/SesameOntologyManager&amp;oldid=285845">Permanent link</a></li> </ul>
</div>
<!-- Additions and mods for leftside nav End here -->
<div id="column-content">
<div id="content">
<a name="top" id="top"></a>
<div id="tabs">
<ul class="primary">
<li class="active"><a href="SesameOntologyManager.html"><span class="tab">Page</span></a></li>
<li><a href="http://wiki.eclipse.org/index.php?title=Talk:SMILA/Documentation/SesameOntologyManager&amp;action=edit"><span class="tab">Discussion</span></a></li>
<li><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/SesameOntologyManager&amp;action=edit"><span class="tab">View source</span></a></li>
<li><a href="http://wiki.eclipse.org/index.php?title=SMILA/Documentation/SesameOntologyManager&amp;action=history"><span class="tab">History</span></a></li>
<li><a href="http://wiki.eclipse.org/index.php?title=Special:Userlogin&amp;returnto=SMILA/Documentation/SesameOntologyManager"><span class="tab">Edit</span></a></li>
</ul>
</div>
<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
<h1 class="firstHeading">SMILA/Documentation/SesameOntologyManager</h1>
<div id="bodyContent">
<h3 id="siteSub">From Eclipsepedia</h3>
<div id="contentSub"><span class="subpages">&lt; <a href="../../SMILA.html" title="SMILA">SMILA</a> | <a href="../Documentation.1.html" title="SMILA/Documentation">Documentation</a></span></div>
<div id="jump-to-nav">Jump to: <a href="SesameOntologyManager.html#column-one">navigation</a>, <a href="SesameOntologyManager.html#searchInput">search</a></div> <!-- start content -->
<p>This page describes an initial integration of a semantic layer in SMILA. It currently consists basically of an integration of <a href="http://www.aduna-software.com/technology/sesame" class="external text" title="http://www.aduna-software.com/technology/sesame" rel="nofollow">Aduna</a>'s <a href="http://www.openrdf.org/" class="external text" title="http://www.openrdf.org/" rel="nofollow">OpenRDF Sesame 2</a>, an open source framework for storage, inferencing, and querying of RDF data. We do not provide an own RDF API on its own currently, but just reuse the Sesame API. Based on experiences from actual use cases for the Semantic Layer, this might change in the future.
</p><p>Consequently, this page assumes that the reader is accustomed to the basic Sesame concepts. A quick browse through Sesame's <a href="http://www.openrdf.org/doc/sesame2/users/" class="external text" title="http://www.openrdf.org/doc/sesame2/users/" rel="nofollow">User Guide</a> should help, especially the chapters <a href="http://www.openrdf.org/doc/sesame2/users/ch03.html" class="external text" title="http://www.openrdf.org/doc/sesame2/users/ch03.html" rel="nofollow">3</a> and <a href="http://www.openrdf.org/doc/sesame2/users/ch08.html" class="external text" title="http://www.openrdf.org/doc/sesame2/users/ch08.html" rel="nofollow">8</a>.
</p><p>All of the described code is contained in bundle <tt>org.eclipse.smila.ontology</tt>.
</p>
<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
<ul>
<li class="toclevel-1"><a href="SesameOntologyManager.html#Introduction"><span class="tocnumber">1</span> <span class="toctext">Introduction</span></a></li>
<li class="toclevel-1"><a href="SesameOntologyManager.html#Discussion"><span class="tocnumber">2</span> <span class="toctext">Discussion</span></a></li>
<li class="toclevel-1"><a href="SesameOntologyManager.html#Sesame_Ontology_Manager"><span class="tocnumber">3</span> <span class="toctext">Sesame Ontology Manager</span></a>
<ul>
<li class="toclevel-2"><a href="SesameOntologyManager.html#Service"><span class="tocnumber">3.1</span> <span class="toctext">Service</span></a>
<ul>
<li class="toclevel-3"><a href="SesameOntologyManager.html#Memory_Store"><span class="tocnumber">3.1.1</span> <span class="toctext">Memory Store</span></a></li>
<li class="toclevel-3"><a href="SesameOntologyManager.html#Native_Store"><span class="tocnumber">3.1.2</span> <span class="toctext">Native Store</span></a></li>
<li class="toclevel-3"><a href="SesameOntologyManager.html#Rdbms_Store"><span class="tocnumber">3.1.3</span> <span class="toctext">Rdbms Store</span></a></li>
<li class="toclevel-3"><a href="SesameOntologyManager.html#HTTP_Store"><span class="tocnumber">3.1.4</span> <span class="toctext">HTTP Store</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="SesameOntologyManager.html#JMX_Management_Agent"><span class="tocnumber">3.2</span> <span class="toctext">JMX Management Agent</span></a></li>
</ul>
</li>
<li class="toclevel-1"><a href="SesameOntologyManager.html#Pipelets_using_the_Ontology"><span class="tocnumber">4</span> <span class="toctext">Pipelets using the Ontology</span></a>
<ul>
<li class="toclevel-2"><a href="SesameOntologyManager.html#Writing.2FReading_complete_records_to.2Ffrom_the_ontology"><span class="tocnumber">4.1</span> <span class="toctext">Writing/Reading complete records to/from the ontology</span></a>
<ul>
<li class="toclevel-3"><a href="SesameOntologyManager.html#org.eclipse.smila.ontology.pipelets.SesameRecordWriterPipelet"><span class="tocnumber">4.1.1</span> <span class="toctext">org.eclipse.smila.ontology.pipelets.SesameRecordWriterPipelet</span></a></li>
<li class="toclevel-3"><a href="SesameOntologyManager.html#org.eclipse.smila.ontology.pipelets.SesameRecordReaderPipelet"><span class="tocnumber">4.1.2</span> <span class="toctext">org.eclipse.smila.ontology.pipelets.SesameRecordReaderPipelet</span></a></li>
</ul>
</li>
<li class="toclevel-2"><a href="SesameOntologyManager.html#org.eclipse.smila.ontology.pipelets.CreateResourcePipelet"><span class="tocnumber">4.2</span> <span class="toctext">org.eclipse.smila.ontology.pipelets.CreateResourcePipelet</span></a></li>
<li class="toclevel-2"><a href="SesameOntologyManager.html#org.eclipse.smila.ontology.pipelets.CreateRelationPipelet"><span class="tocnumber">4.3</span> <span class="toctext">org.eclipse.smila.ontology.pipelets.CreateRelationPipelet</span></a></li>
</ul>
</li>
</ul>
</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
<a name="Introduction"></a><h2> <span class="mw-headline"> Introduction </span></h2>
<p>Ontologies can be used to describe background knowledge about an application domain that can be used during indexing to derive additional attributes of for documents or during search to enhance or restrict queries. On the other hand, SMILA pipelets can also be used to add additional data to an existing ontology, i.e. to learn descriptions of and relations between entities of the application domain.
</p><p>The de-facto standard format for describing such knowledge is RDF. RDF describes everything in the form of resources and triples (statements) about these resources. A resource is identified by a URI, e.g. <tt><a href="http://www.eclipse.org/smila" class="external free" title="http://www.eclipse.org/smila" rel="nofollow">http://www.eclipse.org/smila</a></tt>. A statement consists of a subject resource, a predicate resource and object. The predicate describes the meaning of the statement. The object can either be a literal of different types, e.g.
</p>
<table border="1">
<tr>
<th> Subject
</th><th> Predicate
</th><th> Object
</th></tr>
<tr>
<td> <a href="http://www.eclipse.org/smila" class="external free" title="http://www.eclipse.org/smila" rel="nofollow">http://www.eclipse.org/smila</a>
</td><td> label
</td><td> 'SMILA'
</td></tr>
<tr>
<td> <a href="http://www.eclipse.org/smila" class="external free" title="http://www.eclipse.org/smila" rel="nofollow">http://www.eclipse.org/smila</a>
</td><td> createdIn
</td><td> 2007
</td></tr></table>
<p>or another resource, e.g.
</p>
<table border="1">
<tr>
<th>Subject
</th><th>Predicate
</th><th>Object
</th></tr>
<tr>
<td> <a href="http://www.eclipse.org/smila" class="external free" title="http://www.eclipse.org/smila" rel="nofollow">http://www.eclipse.org/smila</a>
</td><td> type
</td><td> <a href="http://www.eclipse.org/Project" class="external free" title="http://www.eclipse.org/Project" rel="nofollow">http://www.eclipse.org/Project</a>
</td></tr>
<tr>
<td> <a href="http://www.eclipse.org/smila" class="external free" title="http://www.eclipse.org/smila" rel="nofollow">http://www.eclipse.org/smila</a>
</td><td> isPartOf
</td><td> <a href="http://www.eclipse.org/rt/" class="external free" title="http://www.eclipse.org/rt/" rel="nofollow">http://www.eclipse.org/rt/</a>
</td></tr>
<tr>
<td> <a href="http://wiki.eclipse.org/User:Juergen.schumacher.empolis.com" class="external free" title="http://wiki.eclipse.org/User:Juergen.schumacher.empolis.com" rel="nofollow">http://wiki.eclipse.org/User:Juergen.schumacher.empolis.com</a>
</td><td> isComitterOf
</td><td> <a href="http://www.eclipse.org/smila" class="external free" title="http://www.eclipse.org/smila" rel="nofollow">http://www.eclipse.org/smila</a>
</td></tr></table>
<p>Data is written to an RDF ontology by adding or removing statements. Also, it can be read using a statement e.g. by asking for all statements with the predicate <tt>hasPartOf</tt>. Another possibilty is to use an RDF query language like <a href="http://en.wikipedia.org/wiki/SPARQL" class="external text" title="http://en.wikipedia.org/wiki/SPARQL" rel="nofollow">SPARQL</a> that allows formulating very complex patterns to access RDF data.
</p>
<a name="Discussion"></a><h2> <span class="mw-headline"> Discussion </span></h2>
<p>... add your thoughts here ...
</p>
<a name="Sesame_Ontology_Manager"></a><h2> <span class="mw-headline"> Sesame Ontology Manager </span></h2>
<a name="Service"></a><h3> <span class="mw-headline"> Service </span></h3>
<p>The Sesame Ontology Manager is an OSGi service that manages Sesame repositories. It has a configuration file that describes a number of repositories that can be created or used and associates them with a name. Service consumers can then request a connection to one of the repositories by its name. A repository is created with the first access from a client.
</p><p>Then configuration file is expected in the configuration area at <tt>org.eclipse.smila.ontology/sesameConfig.xml</tt>. You can find the schema definition in bundle <tt>org.eclipse.smila.ontology</tt> in directory <tt>schema</tt>. This is fairly complete with respect to the supported repositories:
</p>
<div dir="ltr" style="text-align: left;"><pre class="source-xml"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;UTF-8&quot;</span><span class="re2">?&gt;</span></span>
<span class="sc3"><span class="re1">&lt;SesameConfiguration</span> <span class="re0">default</span>=<span class="st0">&quot;native&quot;</span> <span class="re0">xmlns</span>=<span class="st0">&quot;http://www.eclipse.org/smila/ontology&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;RepositoryConfig</span> <span class="re0">name</span>=<span class="st0">&quot;memory&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;MemoryStore</span> <span class="re0">persist</span>=<span class="st0">&quot;true&quot;</span> <span class="re0">syncDelay</span>=<span class="st0">&quot;1000&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Stackable</span> <span class="re0">classname</span>=<span class="st0">&quot;org.openrdf.sail.inferencer.fc.ForwardChainingRDFSInferencer&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;/RepositoryConfig<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;RepositoryConfig</span> <span class="re0">name</span>=<span class="st0">&quot;native&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;NativeStore</span> <span class="re0">forceSync</span>=<span class="st0">&quot;true&quot;</span> <span class="re0">indexes</span>=<span class="st0">&quot;spoc,posc&quot;</span> <span class="re2">/&gt;</span></span>
<span class="sc3"><span class="re1">&lt;/RepositoryConfig<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;RepositoryConfig</span> <span class="re0">name</span>=<span class="st0">&quot;database&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;RdbmsStore</span> <span class="re0">driver</span>=<span class="st0">&quot;org.postgresql.Driver&quot;</span> <span class="re0">maxTripleTables</span>=<span class="st0">&quot;1&quot;</span> <span class="re0">indexed</span>=<span class="st0">&quot;true&quot;</span> <span class="re0">sequenced</span>=<span class="st0">&quot;true&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Url<span class="re2">&gt;</span></span></span>jdbc:postgresql://localhost/sesame<span class="sc3"><span class="re1">&lt;/Url<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;User<span class="re2">&gt;</span></span></span>sesame<span class="sc3"><span class="re1">&lt;/User<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;Password<span class="re2">&gt;</span></span></span>sesame<span class="sc3"><span class="re1">&lt;/Password<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/RdbmsStore<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/RepositoryConfig<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;RepositoryConfig</span> <span class="re0">name</span>=<span class="st0">&quot;remote&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;HttpStore</span> <span class="re0">repositoryId</span>=<span class="st0">&quot;repository&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;Url<span class="re2">&gt;</span></span></span>http://localhost:8080/sesame<span class="sc3"><span class="re1">&lt;/Url<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/HttpStore<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/RepositoryConfig<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/SesameConfiguration<span class="re2">&gt;</span></span></span></pre></div>
<p>The root element must specify a default repository name, which must match the <i>name</i> attribute of one of the contained repository configurations. Each single repository configuration is described by a <tt>&lt;RepositoryConfig&gt;</tt> element. It must define a name for the repository. As the name is used as the name of a workspace directory to store the files of memory and native stores in, it should contain only characters suitable for directory names on the current platform. The element must contain one of the different &lt;...Store&gt; elements to describe the physical store type and can (except for HttpStores) contain multiple &lt;Stackable&gt; elements defining implementors of <tt>org.openrdf.sail.StackableSail</tt> that are stacked on the used store sail. If multiple stackables are specified they are added on top of the store in the order of appearance in the XML file. This means, the configuration file describes the actual sail stack bottom-up. Sesame itself contains only two useful classes that could be used here:
</p>
<ul><li> <tt>org.openrdf.sail.inferencer.fc.DirectTypeHierarchyInferencer</tt>
</li><li> <tt>org.openrdf.sail.inferencer.fc.ForwardChainingRDFSInferencer</tt>
</li></ul>
<p>See the <a href="http://www.openrdf.org/doc/sesame2/2.2.4/apidocs/org/openrdf/sail/inferencer/fc/package-summary.html" class="external text" title="http://www.openrdf.org/doc/sesame2/2.2.4/apidocs/org/openrdf/sail/inferencer/fc/package-summary.html" rel="nofollow">Sesame API documentation</a> for details.
</p>
<a name="Memory_Store"></a><h4> <span class="mw-headline"> Memory Store </span></h4>
<p>Creates the repository based on a main memory store. It has only two configuration attributes:
</p>
<table border="1">
<tr>
<th> Attribute
</th><th> Type
</th><th> Default
</th><th> Description
</th></tr>
<tr>
<td> <i>persist</i>
</td><td> true/false
</td><td> false
</td><td> Writes repository content to the workspace so that it can be read again after restarts.
</td></tr>
<tr>
<td> <i>syncDelay</i>
</td><td> integer
</td><td> 0
</td><td> The time (in milliseconds) to wait after a transaction was committed before writing the changed data to file. Setting it to 0 causes the data to be written immediately after a commit. A negative number prevents syncing until shutdown.
</td></tr></table>
<p>See <a href="http://www.openrdf.org/doc/sesame2/users/ch07.html#section-memory-store-config" class="external text" title="http://www.openrdf.org/doc/sesame2/users/ch07.html#section-memory-store-config" rel="nofollow">Sesame User Guide: Memory store configuration</a> for details.
</p>
<a name="Native_Store"></a><h4> <span class="mw-headline"> Native Store </span></h4>
<p>Creates the repository based on Sesame's native file database format. It has two configuration attributes:
</p>
<table border="1">
<tr>
<th> Attribute
</th><th> Type
</th><th> Default
</th><th> Description
</th></tr>
<tr>
<td> <i>indexes</i>
</td><td> string
</td><td> -
</td><td> An index string like "spoc,posc" that describes how the RDF data is being indexed for better query performance.
</td></tr>
<tr>
<td> <i>forceSync</i>
</td><td> true/false
</td><td> false
</td><td> Force sync to the hard disk on every write. This makes sure that each change is actually persisted in the data files immediately, but decreases write performance.
</td></tr></table>
<p>See <a href="http://www.openrdf.org/doc/sesame2/users/ch07.html#section-native-store-config" class="external text" title="http://www.openrdf.org/doc/sesame2/users/ch07.html#section-native-store-config" rel="nofollow">Sesame User Guide: Native store configuration</a> for details.
</p>
<a name="Rdbms_Store"></a><h4> <span class="mw-headline"> Rdbms Store </span></h4>
<p>Creates a repository that is stored in a relational database. Sesame currently supports PostgreSQL and MySQL. Bundles containing the JDBC driver are currently not part of the SMILA distribution, so you must add them yourself. The element has four possible attributes:
</p>
<table border="1">
<tr>
<th> Attribute
</th><th> Type
</th><th> Default
</th><th> Description
</th></tr>
<tr>
<td> <i>driver</i>
</td><td> string
</td><td> (required)
</td><td> The class name of the JDBC driver.
</td></tr>
<tr>
<td> <i>maxTripleTables</i>
</td><td> integer
</td><td> 1
</td><td> The number of triple tables created by Sesame. The default value causes all statements to be stored in a single table. If more tables are allowed, Sesame creates a separate table per predicate. This may increase performance for large ontologies, however, allowing too many tables might decrease performance again.
</td></tr>
<tr>
<td> <i>indexed</i>
</td><td> true/false
</td><td> true
</td><td> Controls the creation of DB indexes. Usually, this should be enabled for better performance.
</td></tr>
<tr>
<td> <i>sequenced</i>
</td><td> true/false
</td><td> true
</td><td> (I did not find any explanation for this option in the Sesame documentation or source code, but if you know what it does, you can use it&nbsp;;-)
</td></tr></table>
<p>The actual database location is configured by up to three sub-elements:
</p>
<table border="1">
<tr>
<th> Tag
</th><th> Type
</th><th> Required
</th><th> Description
</th></tr>
<tr>
<td> <i>Url</i>
</td><td> string
</td><td> yes
</td><td> JDBC URL
</td></tr>
<tr>
<td> <i>User</i>
</td><td> string
</td><td> no
</td><td> User name for login
</td></tr>
<tr>
<td> <i>Password </i>
</td><td> string
</td><td> no
</td><td> Password for login
</td></tr></table>
<p>If the database does not require authentication, it may be possible to omit User and Password elements.
</p><p>See <a href="http://www.openrdf.org/doc/sesame2/users/ch07.html#section-rdbms-store-config" class="external text" title="http://www.openrdf.org/doc/sesame2/users/ch07.html#section-rdbms-store-config" rel="nofollow">Sesame User Guide: RDBMS store configuration</a> for details.
</p>
<a name="HTTP_Store"></a><h4> <span class="mw-headline"> HTTP Store </span></h4>
<p>Creates a repository that connects to a remote Sesame HTTP repository server. There is only one configuration attribute on the HttpStore element:
</p>
<table border="1">
<tr>
<th> Attribute
</th><th> Type
</th><th> Default
</th><th> Description
</th></tr>
<tr>
<td> <i>repositoryId</i>
</td><td> string
</td><td> (required)
</td><td> name of repository in server.
</td></tr></table>
<p>The actual repository server location is configured by up to three sub-elements:
</p>
<table border="1">
<tr>
<th> Tag
</th><th> Type
</th><th> Required
</th><th> Description
</th></tr>
<tr>
<td> <i>Url</i>
</td><td> string
</td><td> yes
</td><td>HTTP URL of the repository server
</td></tr>
<tr>
<td> <i>User</i>
</td><td> string
</td><td> no
</td><td> User name for login
</td></tr>
<tr>
<td> <i>Password</i>
</td><td> string
</td><td> no
</td><td> Password for login
</td></tr></table>
<p>If the repository server does not require authentication, User and Password can be ommitted. It is not possible to add stackable sails to an HTTP repository. This must be configured on the repository server.
</p><p>See <a href="http://www.openrdf.org/doc/sesame2/users/ch07.html#d0e575" class="external text" title="http://www.openrdf.org/doc/sesame2/users/ch07.html#d0e575" rel="nofollow">Sesame User Guide: HTTP repository configuration</a> for details.
</p>
<a name="JMX_Management_Agent"></a><h3> <span class="mw-headline"> JMX Management Agent </span></h3>
<p>There is also a JMX management agent that can be used to import RDF data from files into an ontology, export complete repository contents to an RDF file, and clear repositories. Additionally, it allows reading some information such as the available repository names, the known namespaces, and the size of repositories.
</p><p>In the JDK JMX console it should look similar to this screenshot:
</p><p><a href="http://wiki.eclipse.org/Image:SMILA_Sesame_Ontology_Manager.png" class="image" title="Image:SMILA Sesame Ontology Manager.png"><img alt="Image:SMILA Sesame Ontology Manager.png" src="http://wiki.eclipse.org/images/8/8f/SMILA_Sesame_Ontology_Manager.png" width="799" height="422" border="0" /></a>
</p><p>Since the first parameter of each operation is usually the name of the desired repository, we will only describe additional parameters here:
</p>
<table border="1">
<tr>
<th> operation
</th><th> description
</th></tr>
<tr>
<td> <i>getRepositoryNames</i>
</td><td> Returns the names of all configured repositories. These names can be used as the first parameter of the other methods.
</td></tr>
<tr>
<td> <i>getSize</i>
</td><td> Returns the total number of statemets in the named repository.
</td></tr>
<tr>
<td> <i>getNamespaces</i>
</td><td> Returns a map of namespace prefixes to the complete names in the named repository.
</td></tr>
<tr>
<td> <i>getContexts</i>
</td><td> Returns a list of context names in the named repository.
</td></tr>
<tr>
<td> <i>clear</i>
</td><td> Removes all resources and statements from the named repository. The result is a message about the operation.
</td></tr>
<tr>
<td> <i>importRDF''</i>
</td><td> Imports an RDF file into the named repository. The second parameter is the path and filename of the import file, absolute or relative to SMILA's working directory. The third parameter is the base URI for relative resource URIs in this file. If only absolute resource URIs are used in the RDF file, the actual value of this parameter is irrelevant. The format of the file is determined by looking at the filename suffix, if no match is found, RDF/XML is assumed.
</td></tr>
<tr>
<td> <i>exportRDF</i>
</td><td> Exports a complete repository content to an RDF file. The second parameter is the path and filename of the export file, absolute or relative to SMILA's working directory. The format of the file is determined by looking at the filename suffix, if no match is found, RDF/XML is assumed.
</td></tr></table>
<p>There are also exemplary batch files for importing, exporting, or running the clear operation from the command line. See <tt>SMILA/jmxclient</tt> for details and adapt them to your own needs.
</p><p>Currently, supported file formats and extensions include:
</p>
<table border="1">
<tr>
<th> RDF format
</th><th> filename suffixes
</th></tr>
<tr>
<td> RDF/XML
</td><td> .rdf, .rdfs, .owl
</td></tr>
<tr>
<td> N-Triples
</td><td> .nt
</td></tr>
<tr>
<td> Turtle
</td><td> .ttl
</td></tr>
<tr>
<td> N3
</td><td> .n3
</td></tr>
<tr>
<td> TRIX
</td><td> .trix
</td></tr>
<tr>
<td> TRIG
</td><td> .trig
</td></tr></table>
<p>The .xml suffix is associated to both RDF/XML and TRIX in Sesame, so there may be problems using it.
</p>
<a name="Pipelets_using_the_Ontology"></a><h2> <span class="mw-headline"> Pipelets using the Ontology </span></h2>
<p>There are currently four pipelets included that make use of the ontology service. These pipelets are also kind of experimental, so they may change completely in the future. More pipelets will be created when we implement "real" use cases.
</p><p>All pipelets use the standard in-BPEL pipelet configuration which can be overridden per record by simple values in the <tt>_parameters</tt> map attribute. All pipelets use a common property name to select the repository to work with:
</p>
<table border="1">
<tr>
<th> Property
</th><th> Type
</th><th> Description
</th></tr>
<tr>
<td> <i>sesameRepository</i>
</td><td> string
</td><td> The name of the repository to use. If not set, the default repository is used.
</td></tr></table>
<a name="Writing.2FReading_complete_records_to.2Ffrom_the_ontology"></a><h3> <span class="mw-headline"> Writing/Reading complete records to/from the ontology </span></h3>
<p>There are two pipelets that can be used to create and access information about a record in/from the ontology: The resource URI can be read from a special attribute named <i>rdf:about</i>, the resource property is written from or read into metadata attributes.
</p><p>These pipelets have another parameter in common:
</p>
<table border="1">
<tr>
<th> Property
</th><th> Type
</th><th> Description
</th></tr>
<tr>
<td> <i>recordFilter</i>
</td><td> string
</td><td> The name of a record filter that lists all attributes that should be interpreted as resource properties. Note that the <i>rdf:about</i> attribute must be contained in this filter if it is used to identify the resource associated to the object. The record filters must be defined in <tt>configuration/org.eclipse.smila.blackboard</tt>, because the pipelets use blackboard functionality to do the filtering. If not set, all attributes are mapped to properties.
</td></tr></table>
<p>The URI of the resource associated to a processed record is determined this way:
</p>
<ul><li> If attribute "rdf:about" has literal values (after record filtering), the first one is used as the base value.
</li><li> If the part of the base value before the first ':' character matches a namespace prefix in the used repository, the prefix is replaced by the full name.
</li><li> The resulting value must be accepted by Sesame as an URI string. If not, the record is not processed any further.
</li></ul>
<a name="org.eclipse.smila.ontology.pipelets.SesameRecordWriterPipelet"></a><h4> <span class="mw-headline"> org.eclipse.smila.ontology.pipelets.SesameRecordWriterPipelet </span></h4>
<p>This pipelet can write attribute values to RDF properties. It creates a resource URI for the record it finds in the corresponding attribute and for each top-level attribute value of the record metadata object, it creates statements using this URI as the subject and the attribute name as a predicate URI. If an attribute name starts with a namespace prefix known in the used repository, it is expanded to the full namespace name. The statement object is created from a SMILA literal vaulue as follow:
</p>
<ul><li> If the attribute is a map and contains an attribute with a name of "rdf:about", a resource is created from the sub-structure (after namespace prefix expansion) and its URI is linked to the containing structure.
</li><li> Else a literal of the ontology literal datatype best matching the SMILA literal datatype is created (TODO: Not yet implemented for data/time values).
</li></ul>
<p>The pipelet can be configured in which attribute to find the URI. To find out how, see the parameter desciption below.
</p><p>Any system attribute (i.e. any attribute with the name starting with an underscore "_" will be ignored and not written into sesame.
</p><p>If references to objects should be created, the attributes containing object references have to be marked by a special attribute named <i>_objectProperties</i>:
</p>
<div dir="ltr" style="text-align: left;"><pre class="source-xml"><span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:about&quot;</span><span class="re2">&gt;</span></span>eclipse:smila<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
...
<span class="sc3"><span class="re1">&lt;rec:Seq</span> <span class="re0">key</span>=<span class="st0">&quot;_objectProperties&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;rec:Val<span class="re2">&gt;</span></span></span>eclipse:isPartOf<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Seq<span class="re2">&gt;</span></span></span></pre></div>
<p>So, to create a resource in the repository as in the example in the introduction, a record like this could be used:
</p>
<div dir="ltr" style="text-align: left;"><pre class="source-xml"><span class="sc3"><span class="re1">&lt;rec:Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:about&quot;</span><span class="re2">&gt;</span></span>eclipse:smila<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Map</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:type&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:about&quot;</span><span class="re2">&gt;</span></span>eclipse:Project<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:type&quot;</span><span class="re2">&gt;</span></span>rdfs:Resource<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Seq</span> <span class="re0">key</span>=<span class="st0">&quot;eclipse:isPartOf&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;rec:Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:about&quot;</span><span class="re2">&gt;</span></span>eclipse:rt<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:type&quot;</span><span class="re2">&gt;</span></span>eclipse:TopLevelProject<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Map<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val<span class="re2">&gt;</span></span></span>http://www.eclipse.org/<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Seq<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdfs:label&quot;</span><span class="re2">&gt;</span></span>SMILA<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;eclipse:createdIn&quot;</span><span class="re2">&gt;</span></span>2007<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
&nbsp;
<span class="sc3"><span class="re1">&lt;rec:Seq</span> <span class="re0">key</span>=<span class="st0">&quot;_objectProperties&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;rec:Val<span class="re2">&gt;</span></span></span>eclipse:isPartOf<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Seq<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Map<span class="re2">&gt;</span></span></span></pre></div>
<p>(Assuming the target repository knows the namespaces "rdf", "rdfs" (standard namespaces) and "eclipse" (= "<a href="http://www.eclipse.org/" class="external free" title="http://www.eclipse.org/" rel="nofollow">http://www.eclipse.org/</a>").
</p><p>A string literal with a language can be written using a map with the language name as key and the locale specific value as value of the map:
</p>
<div dir="ltr" style="text-align: left;"><pre class="source-xml"><span class="sc3"><span class="re1">&lt;rec:Map</span> <span class="re0">key</span>=<span class="st0">&quot;rdfs:label&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;de&quot;</span><span class="re2">&gt;</span></span>SMILA<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;en&quot;</span><span class="re2">&gt;</span></span>SMILA<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Map<span class="re2">&gt;</span></span></span></pre></div>
<p>By default, new statements are just added to the repository. If all existing statements for a given subject and object should be removed before adding the new statements, special system attributes can be used.
</p><p>To remove all statements before adding the new statements, add an attribute named "_deleteAll" with a value "true":
</p>
<div dir="ltr" style="text-align: left;"><pre class="source-xml"><span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:about&quot;</span><span class="re2">&gt;</span></span>eclipse:smila<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;_deleteAll&quot;</span><span class="re2">&gt;</span></span>true<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span></pre></div>
<p>To remove only some properties before adding the new statements, add a sequence attribute named "_deleteProperties" that contains a sequence of properties to be deleted on beforehand.
</p>
<div dir="ltr" style="text-align: left;"><pre class="source-xml"><span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:about&quot;</span><span class="re2">&gt;</span></span>eclipse:smila<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
...
<span class="sc3"><span class="re1">&lt;rec:Seq</span> <span class="re0">key</span>=<span class="st0">&quot;_deleteProperties&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;rec:Val<span class="re2">&gt;</span></span></span>eclipse:isCommitterOf<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val<span class="re2">&gt;</span></span></span>rdfs:label<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Seq<span class="re2">&gt;</span></span></span></pre></div>
<p>To create a statement with the record URI as the object and the attribute value as the subject, put the attribute value "_reverseProperties" containing a list of the reverse properties in the record. This only works if the attribute value is specified to be a resource URI. E.g. the final statement of the introductory example can be created from the same record using:
</p>
<div dir="ltr" style="text-align: left;"><pre class="source-xml"><span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;rdf:about&quot;</span><span class="re2">&gt;</span></span>eclipse:smila<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Val</span> <span class="re0">key</span>=<span class="st0">&quot;eclipse:isCommitterOf&quot;</span><span class="re2">&gt;</span></span>http://wiki.eclipse.org/User:Juergen.schumacher.empolis.com<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;rec:Seq</span> <span class="re0">key</span>=<span class="st0">&quot;_reverseProperties&quot;</span><span class="re2">&gt;</span></span>
<span class="sc3"><span class="re1">&lt;rec:Val<span class="re2">&gt;</span></span></span>eclipse:isCommitterOf<span class="sc3"><span class="re1">&lt;/rec:Val<span class="re2">&gt;</span></span></span>
<span class="sc3"><span class="re1">&lt;/rec:Seq<span class="re2">&gt;</span></span></span></pre></div>
<p>Finally, the pipelet supports these additional parameters:
</p>
<table border="1">
<tr>
<th> Property
</th><th> Type
</th><th> Description
</th></tr>
<tr>
<td> <i>typeUri</i>
</td><td> string
</td><td> optional: name of type to set for the resource, if no type statement is created from writing the record.
</td></tr>
<tr>
<td> <i>uriAttribute</i>
</td><td> string
</td><td> optional: attribute to write the URIs of found/created resources to. Default: <i>rdf:about</i>
</td></tr></table>
<p>If you want to implement own pipelets that create attribute values for writing to the repository, see <tt>org.eclipse.smila.ontology.records.SesameRecordHelper</tt> for constants and helper methods for these special conventions and annotations.
</p><p>If an error occurs while writing a record to the repository, only the changes related to the current record are rolled back, and the pipelet fails with an exception, further records in the same message are not processed anymore, changes from records written before are not invalidated. (TODO: discuss general pipelet error handling behavior?)
</p>
<a name="org.eclipse.smila.ontology.pipelets.SesameRecordReaderPipelet"></a><h4> <span class="mw-headline"> org.eclipse.smila.ontology.pipelets.SesameRecordReaderPipelet </span></h4>
<p>This pipelet reads statements from the repository about the URI associated with a record into attribute values of the record. Its operation is mostly inverse to the one of the SesameRecordWriterPipelet, so we can keep the description short here. Some notes:
</p>
<ul><li> Only statements are used that have the record URI as subject. No "reverse" attributes are created.
</li><li> Resource objects are converted to string literals.
</li><li> Literal objects are converted to best matching SMILA literal datatype (TODO: date/time objects).
</li><li> a language tag on a string literal is stored as a AnyMap as described above.
</li><li> All statements are read from the repository, but only those attributes contained in the specified record filter are written to the blackbaord eventually.
</li><li> If predicate URIs start with known name namespaces, the full namespace value is replaced by its prefix and a colon in the associated attribute name.
</li></ul>
<p>If an error occurs during reading the records, the pipelet invocation is aborted at this point. If multiple records where processed in this called, changes to already processed records are not reverted.
</p><p>The pipelet can be configured in which attribute to find the URI:
</p>
<table border="1">
<tr>
<th> Property
</th><th> Type
</th><th> Description
</th></tr>
<tr>
<td> <i>uriAttribute</i>
</td><td> string
</td><td> optional: attribute to write the URIs of found/created resources to. Default: <i>rdf:about</i>
</td></tr></table>
<a name="org.eclipse.smila.ontology.pipelets.CreateResourcePipelet"></a><h3> <span class="mw-headline"> org.eclipse.smila.ontology.pipelets.CreateResourcePipelet </span></h3>
<p>This pipelet can be used to lookup and create resources of a certain types by their name. E.g. if some attribute contains the name of a person, this pipelet can search the ontology for a resource of type "person" with this name, and if no such resource exists, it can create a new one. In either case the URI of this resource is written to (another) attribute. The URI of a new resource is created from the label by removing all non-word characters (i.e. everything except a-z, A-Z, _, 0-9) from the string and concatenating the result to some configurable prefix value (see below).
</p><p>The pipelet supports the following parameters:
</p>
<table border="1">
<tr>
<th> Property
</th><th> Type
</th><th> Description
</th></tr>
<tr>
<td> <i>typeUri</i>
</td><td> string
</td><td> required: URI of type to use for lookup and creation of resources. Namespace expansion is applied to this URI.
</td></tr>
<tr>
<td> <i>labelAttribute</i>
</td><td> string
</td><td> required: attribute containing names of resources to lookup/create.
</td></tr>
<tr>
<td> <i>uriAttribute</i>
</td><td> string
</td><td> required: attribute to write the URIs of found/created resources to.
</td></tr>
<tr>
<td> <i>labelPredicate</i>
</td><td> string
</td><td> optional: URI of the predicate that specifies the name of the resource. If not set, it defaults to rdfs:label. Namespace expansion is applied to the property value.
</td></tr>
<tr>
<td> <i>uriPrefix</i>
</td><td> string
</td><td> optional: prefix for new created URIs. If not set, "urn:" is used. Namespace expansion is also applied to the complete new URI.
</td></tr></table>
<a name="org.eclipse.smila.ontology.pipelets.CreateRelationPipelet"></a><h3> <span class="mw-headline"> org.eclipse.smila.ontology.pipelets.CreateRelationPipelet </span></h3>
<p>This pipelet creates statements with subjects and objects read from record attributes. It create a statement with a configurable predicate in the target repository for each combination of values in two configurable attributes. E.g. if one attribute of your records contains URIs of persons and another one URIs of companies they work for, this pipelet could be used to create statements in the ontology using some "worksFor" predicate to describe this relation.
</p><p>By default the given objectAttributes are interpreted as URIs. If the objectAttributes should be interpreted as literals, the parameter <i>objectAttributeIsResource</i> has to be set to <i>false</i> in the pipelet configuration.
</p><p>The pipelet supports the following parameters:
</p>
<table border="1">
<tr>
<th> Property
</th><th> Type
</th><th> Description
</th></tr>
<tr>
<td> <i>subjectAttribute</i>
</td><td> string
</td><td> required: name of attribute containing the subjects for the statements to create. Regardless of the actual literal type, the string values of the literals are tried to interpred as URIs. Namespace expansion is applied.
</td></tr>
<tr>
<td> <i>objectAttribute</i>
</td><td> string
</td><td> required: name of attribute containing the objects for the statements to create. If the pipelet parameter <i>objectAttributeIsResource</i> is not explicitly set to <i>false</i> the objects will be URIs (namespaces expanded). Else the SMILA literal values will be written as Sesame literals with a matching datatype.
</td></tr>
<tr>
<td> <i>predicateUri</i>
</td><td> string
</td><td> required: URI of the predicate for the statements. Namespace prefixes are expanded first.
</td></tr>
<tr>
<td> <i>objectAttributeIsResource</i>
</td><td> Boolean
</td><td> optional: if <i>true</i> the objects are interpreted as URIs, if <i>false</i> the objects attributes are interpreted as literals. Default: <i>true</i>.
</td></tr></table>
<!--
NewPP limit report
Preprocessor node count: 51/1000000
Post-expand include size: 0/2097152 bytes
Template argument size: 0/2097152 bytes
#ifexist count: 0/100
-->
<!-- Saved in parser cache with key wikidb:pcache:idhash:18404-0!1!0!!en!2!edit=0 and timestamp 20120709210951 -->
<div class="printfooter">
Retrieved from "<a href="SesameOntologyManager.html">http://wiki.eclipse.org/SMILA/Documentation/SesameOntologyManager</a>"</div>
<div id="catlinks"><p class='catlinks'><a href="http://wiki.eclipse.org/Special:Categories" title="Special:Categories">Category</a>: <span dir='ltr'><a href="http://wiki.eclipse.org/Category:SMILA" title="Category:SMILA">SMILA</a></span></p></div> <!-- end content -->
<div class="visualClear"></div>
</div>
</div>
</div>
<!-- Yoink of toolbox for phoenix moved up -->
</div>
</div>
<div id="clearFooter"/>
<div id="footer" >
<ul id="footernav">
<li class="first"><a href="http://www.eclipse.org/">Home</a></li>
<li><a href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a></li>
<li><a href="http://www.eclipse.org/legal/termsofuse.php">Terms of Use</a></li>
<li><a href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a></li>
<li><a href="http://www.eclipse.org/org/foundation/contact.php">Contact</a></li>
<li><a href="http://wiki.eclipse.org/Eclipsepedia:About" title="Eclipsepedia:About">About Eclipsepedia</a></li>
</ul>
<span id="copyright">Copyright &copy; 2012 The Eclipse Foundation. All Rights Reserved</span>
<p id="footercredit">This page was last modified 15:56, 23 January 2012 by <a href="http://wiki.eclipse.org/User:Andreas.schank.attensity.com" title="User:Andreas.schank.attensity.com">A. Schank</a>. Based on work by <a href="http://wiki.eclipse.org/index.php?title=User:Juergen.schumacher.attensity.com&amp;action=edit" class="new" title="User:Juergen.schumacher.attensity.com">Juergen Schumacher</a>, <a href="http://wiki.eclipse.org/User:Drazen.cindric.attensity.com" title="User:Drazen.cindric.attensity.com">Drazen Cindric</a> and <a href="http://wiki.eclipse.org/User:Juergen.schumacher.empolis.com" title="User:Juergen.schumacher.empolis.com">Juergen Schumacher</a>.</p>
<p id="footerviews">This page has been accessed 5,795 times.</p>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-910670-4");
pageTracker._trackPageview();
</script>
<!-- <div class="visualClear"></div> -->
<script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script>
</div>
<!-- Served in 0.057 secs. --></body></html>