ch.uzh.ifi.attempto.acewiki.core
Class FileBasedStorage

java.lang.Object
  extended by ch.uzh.ifi.attempto.acewiki.core.FileBasedStorage
All Implemented Interfaces:
AceWikiStorage

public class FileBasedStorage
extends java.lang.Object
implements AceWikiStorage

This class implements persistent storage features for AceWiki data on the basis of a simple file and folder based system.

Author:
Tobias Kuhn

Constructor Summary
FileBasedStorage(java.lang.String dir)
          Creates a new storage object.
 
Method Summary
 Ontology getOntology(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> parameters)
          Returns the ontology with the given name (or creates an empty ontology if the ontology cannot be found).
 UserBase getUserBase(Ontology ontology)
          Returns the user base for the given ontology.
 void save(OntologyElement oe)
          Saves the given ontology element.
 void save(User user)
          Saves the given user.
static java.lang.String serialize(java.util.List<OntologyElement> elements)
          Serializes the given list of ontology elements according to the AceWiki data format.
static java.lang.String serialize(OntologyElement element)
          Serializes the given ontology element as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileBasedStorage

public FileBasedStorage(java.lang.String dir)
Creates a new storage object.

Parameters:
dir - The path at which ontologies should be stored.
Method Detail

getOntology

public Ontology getOntology(java.lang.String name,
                            java.util.Map<java.lang.String,java.lang.String> parameters)
Returns the ontology with the given name (or creates an empty ontology if the ontology cannot be found). A parameter map is used for ontology parameters. When the ontology with the respective name has already been loaded, this ontology is returned and the parameters are ignored. The following parameters are supported: "baseuri": The base URI that is used to identify the ontology elements. The complete URI of the ontology is baseURI + name. The default is an empty string. "global_restrictions_policy": A string representing the policy how to enforce the global restrictions on axioms in OWL 2. At the moment, the options "no_chains" and "unchecked" are available. "reasoner": Defines the reasoner or reasoner interface to be used. Currently supported are the HermiT reasoner ("HermiT", default), the Pellet reasoner ("Pellet"), the OWLlink interface ("OWLlink"), or none ("none"). "owl_profile": Sets an OWL profile that defines which statements are used for reasoning. Possible values are "OWL2Full" (default), "OWL2EL", "OWL2QL", and "OWL2RL". Note that the global restrictions of the EL profile are not checked.

Specified by:
getOntology in interface AceWikiStorage
Parameters:
name - The name of the ontology.
parameters - The parameters.
Returns:
The loaded ontology.

save

public void save(OntologyElement oe)
Description copied from interface: AceWikiStorage
Saves the given ontology element.

Specified by:
save in interface AceWikiStorage
Parameters:
oe - The ontology element to be saved.

serialize

public static java.lang.String serialize(OntologyElement element)
Serializes the given ontology element as a string.

Parameters:
element - The ontology element.
Returns:
The serialized representation of the ontology element.

serialize

public static java.lang.String serialize(java.util.List<OntologyElement> elements)
Serializes the given list of ontology elements according to the AceWiki data format.

Parameters:
elements - The list of ontology elements.
Returns:
The serialized representation of the ontology elements.

getUserBase

public UserBase getUserBase(Ontology ontology)
Description copied from interface: AceWikiStorage
Returns the user base for the given ontology.

Specified by:
getUserBase in interface AceWikiStorage
Parameters:
ontology - The ontology.
Returns:
The user base.

save

public void save(User user)
Description copied from interface: AceWikiStorage
Saves the given user.

Specified by:
save in interface AceWikiStorage
Parameters:
user - The user to be saved.


Copyright 2008-2012, AceWiki developers