Table of contents
PIMO Service
A Personal Information Model (PIMO) represents concepts of the user to structure his personal space of information. The PimoService manages these concepts.
Overview
A PimoOntology contains a representation of his/her PIMO (an URI identifying his model), of a generic upper-level ontology (PIMO-upper) modelling basic concepts, of user-defined custom classes, properties, and instances and of imported domain and group ontologies. To say, something is in the user's PIMO is to assume that an instance of pimo:Thing (or a subclass of it) was created representing the concept in question. On the data level, the PIMO is represented as many triples stored in the desktop RdfRepository, namely the triples defining the ontologies and the data added by the user or desktop applications.
More about PIMO:
- PimoOntology
- PIMO.pdf (framework guide)
The PimoService implements commonly used methods to manipulate a PIMO. On the architecture level, the PimoService is running as part of the core services in the Nepomuk desktop server, depending only on RdfRepository. Its main function is to manipulate triples in the RdfRepository in a way that is conformant with NRL and the PIMO ontology framework. Programs can either manipulate the RdfRepository directly, or use the PimoService to achieve these tasks:
- creating and deleting classes, properties, and resources
- adding and removing ontologies
- various convenience methods
The PIMO Service also provides the following facts:
- the URI identifying the user
- the personal namespace of the user
- the URI of the user's personal information model
Authors/Developers
- LeoSauermann (lead programmer, managing)
- MartinKlinkigt (supporting)
Installation Instructions
PimoService is part of the core services and is automatically installed. You can refer to UsingNepomuk as a guide for the installation of Nepomuk
Configuring the PimoService
The PimoService reads its configuration from the RdfRepository. There is a vocabulary defining the values:
- namespace: http://ont.semanticdesktop.org/ontologies/2007/01/16/server-conf# (not uploaded yet)
- server-conf.rdfs vocabulary file
An example configuration looks like this:
<rdf:RDF xmlns="http://ont.semanticdesktop.org/ontologies/2007/01/16/server-conf#"
xmlns:log="http://www.w3.org/2000/10/swap/log#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<User rdf:about="urn:nepomuk:local:userconfig">
<userEmailAddress>johndoe@example.com</userEmailAddress>
<userName>John Doe</userName>
<userNamespace rdf:resource="http://www.example.com/id/johndoe/"/>
<userPimoUri rdf:resource="http://www.example.com/id/johndoe/Graph"/>
<userUri rdf:resource="http://www.example.com/id/johndoe/JohnDoe"/>
</User>
</rdf:RDF>
By default, the configuration is annotated to the uri urn:nepomuk:local:userconfig and stored in named graph urn:nepomuk:local:userconfig:graph. Both are defined in NepomukConstants.java in project ...server.app.
When no configuration is found, above default configuration is inserted in the configuration store and an initial PIMO generated on system startup, to have a stable system running. If this does not work, you will get an org.semanticdesktop.nepomuk.comp.pimoservice.PimoConfigurationException? during startup.
There was a PimoService/WebConfigGui but that is outdated now.
Skipping installation wizard
When Nepomuk is started for the first time it have to run the Nepumuk initialization wizard (see UsingInstaller). It may be wanted to skip the installation wizard. This situation may appear if you have already an existing data in the repository. The setup wizard searches for a configuration triples in the config repository. If below triple is not found in the repository the setup wizard window is shown. To skip this wizard you have to add to the repository a new triple. To add a new triple open the nepomuk server in your browser, go to RDF Repository and select a config repository. Scroll down the page until you reach Add RDF from clipboard. Fill out all fields as described below.
In RDF to add text field paste:
<urn:nepomuk:local:userconfig> <http://ont.semanticdesktop.org/ontologies/2007/01/16/server-conf#wasSetupPerformed> "setupPerformed" .
Base URI leave blank
RDF Format choose turtle
Into Named Graph paste:
urn:nepomuk:local:userconfig:graph
Now press the add RDF button. This will add a new triple to the repository.
You can restart the Nepomuk, an installation wizard will be skipped.
Architecture
Initialization and Startup Phase
A PimoService must initialize the user's pimo on startup, when it doesnt exist. The following changes are done on the first startup:
- create an instance of the PIMO class, the users PIMO
- create the user, an instance of pimo:Person
- add default ontologies to the store: RDF, RDFS, NRL, PIMO
The default ontology uris are:
- http://www.semanticdesktop.org/ontologies/2007/03/19/pimo-temp#
- http://www.w3.org/2000/01/rdf-schema
- http://www.w3.org/1999/02/22-rdf-syntax-ns
Additionally, a context for the user is generated (when your name is Claudia Stern, it is):
When you have changed the configuration (user uri, etc), and want to change the user's pimo to reflect this, the only way at the moment is deleting all data from the main repository. Changing the user's URIs is not supported at this moment, although it would be easy to write scripts that rewrite all the URIs in the database.
Pimo Service
The standard implementation is a stateless server, running as OSGi/Middleware service. All calls to it make immediate changes to the database.
A good overview of the features is given by reading the javadoc of PimoService. The main functionality provided is to implement the ontologies and the assumptions implied by NRL and NEPOMUK agreements in this reference implementation, in normal RDF applications the following functions could be implemented in various ways, resulting in varying outcomes. To support standardization, the PimoService should show how the data in the RdfRepository should be changed.
Here we give a grouping of methods based on functionality:
- PIMO specific
- getPimoUri
- getUserNamespace
- getUserUri
- Ontology handling methods
- addOntology
- checkOntology
- getOntologyDefining
- isOntologyWriteable
- listOntologies
- removeOntology
- setOntologyWriteable
- updateOntology
- validateOntologies
- validateOntology
- Resource, Class, Property
- createClass
- createProperty
- createResource
- createUri
- deleteClass
- deleteProperty
- deleteResource
- Handling instances
- changeTypeOfResource
- createRelation
- deleteRelation
- mergeResourceInto
- updateResource
- NRL specific
- create context
- convenience methods
- getInternationalizedCommentOf
- getInternationalizedLabelOf
- getResource
Pimo Client
There is an alternative implementation as PimoClient, where all operations are done in-memory on the client side (the application calling the methods). This client implementation allows to make changes and commit them in one call, which improves performance and allows, to some extend, a rollback of operations.
Pimo Query
Commonly needed queries, such as what is the thing for this information element? are implemented in the PimoClient, that gives you access to a class called Pimo Query. This class implements some commonly asked queries. If you think you need more queries, add them to the class or ask us.
Using the Component
PimoQuery
Only result, which are stored in the repository will be returned. So keep in mind everything which was created with a ClientSession and isn't commited at the moment will not occur.
Usage:
RDF2GoRepository rdf2gorepository = ... ;
PimoClient client = new PimoClient(rdf2gorepository);
PimoQuery query = client.getPimoQuery();
Collection<URI> belfasts = query.findThingByName("Belf", false, true, 10);
for (URI b : belfasts) {
...
}
One functionality from the PimoQuery is to find tags from a resource. There a two different ways to get the tags from a resource. With listTagsOf(URI resource) you will only get a Collection with all NAO:Tag from the resource. But you can also tag a resource with:
- resource pimo:related tag
- resource pimo:related thing
With the method listAllAnnotationsOf(URI resource) you will also get this tags.
Examples
Programming examples can be found in the JUnit tests of PimoService:
// get access to the PimoService OSGIRegistry registry = .... PimoService pimoservice = registry.getService(PimoService.class);
How to get access to the middleware, see NepomukMiddleware.
// create a new class customer
String customer = pimoservice.createClass("Customer");
// create a new customer
String johndoe = pimoservice.createResource("John Doe", customer);
// delete the customer
pimoservice.deleteResource(johndoe);
There is a JUnit-Test which shows some features from the PimoService. In this test we act like Claudia when she uses Nepomuk to build her Pimo.
Convenient usage is also possible using the PimoClient, see there.
Developing the Component
The component is in SVN, and there are JUnit tests using the NepomukMockup. Development is test-driven and easy to understand once you have the JUnit tests running.
SVN Browsing
The PimoService is implemented in Java as OSGi package:
A Javadoc of the main interface is here:
A WSDL description of the above interface is here:
External References
See also
- PimoClient
- PimoOntology
- http://gnowsis.opendfki.de/wiki/PimoService - the original pimoservice
Detailled documents about PIMO (see also PimoOntology)
- Leo Sauermann, Ludger van Elst, Andreas Dengel: PIMO - a Framework for Representing Personal Information Models. In Proceedings of I-Semantics' 2007. (download)
- Norberto Fernandez-Garcia, Leo Sauermann, Luis Sanchez, Ansgar Bernardi: PIMO Population and Semantic Annotation for the Gnowsis Semantic Desktop. In Proceedings of the Semantic Desktop and Social Semantic Collaboration Workshop at the ISWC 2006. (download)
- Leo Sauermann: PIMO-a PIM Ontology for the Semantic Desktop (draft, this is outdated) (download outdated draft)
Status
The core methods are implemented, many of them work, some don't. The JUnit tests give an indication about this:
What is missing:
- validation using the NrlValidator
Using RDFReactor with the PIMO-Service
To access RDF data using Java Beans, we intend to use RDF Reactor or ELMO with an RDF2Go backend. This is experimental and not done yet.
Attachments
-
pimoconfig.png
(6.4 kB) - added by LeoSauermann
13 months ago.
pimoconfig screenshot
