org.openrdf.sesame.sailimpl.rdbms
Class RdfSchemaRepository

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.rdbms.RdfSource
      extended byorg.openrdf.sesame.sailimpl.rdbms.RdfRepository
          extended byorg.openrdf.sesame.sailimpl.rdbms.RdfSchemaRepository
All Implemented Interfaces:
RdfRepository, RdfSchemaRepository, RdfSchemaSource, RdfSource, Sail, TableNames, ValueFactory
Direct Known Subclasses:
VersioningRdbmsSail

public class RdfSchemaRepository
extends RdfRepository
implements RdfSchemaRepository, TableNames

A portable implementation of the RdfSchemaRepository interface for relational databases. This class defines the RDF Schema specific methods and takes care of RDF Model Theory inferencing. The superclasses define the basic RDF functionality.

Version:
$Revision: 1.15.4.5 $
Author:
Arjohn Kampman

Field Summary
static String INFERENCER_KEY
          Key used to store a fully qualified inferencer class name in the initialization parameters.
 int rdfAltId
           
 int rdfBagId
           
 int rdfFirstId
           
 int rdfListId
           
 int rdfNilId
           
 int rdfObjectId
           
 int rdfPredicateId
           
 int rdfPropertyId
           
 int rdfRestId
           
 int rdfsClassId
           
 int rdfsCommentId
           
 int rdfsContainerId
           
 int rdfsContainerMembershipPropertyId
           
 int rdfsDatatypeId
           
 int rdfsDomainId
           
 int rdfSeqId
           
 int rdfsIsDefinedById
           
 int rdfsLabelId
           
 int rdfsLiteralId
           
 int rdfsMemberId
           
 int rdfsRangeId
           
 int rdfsResourceId
           
 int rdfsSeeAlsoId
           
 int rdfsSubClassOfId
           
 int rdfsSubPropertyOfId
           
 int rdfStatementId
           
 int rdfSubjectId
           
 int rdfTypeId
           
 int rdfValueId
           
 int rdfXMLLiteralId
           
static String USE_DEPENDENCY_INFERENCER_KEY
           
 
Fields inherited from class org.openrdf.sesame.sailimpl.rdbms.RdfSource
JDBC_DRIVER_KEY, JDBC_URL_KEY, KEY_EXPORT_FLAGS, KEY_SCHEMACREATOR, KEY_SCHEMAVERSION, PASSWORD_KEY, USER_KEY, VALUE_DIRTY, VALUE_UP_TO_DATE
 
Fields inherited from interface org.openrdf.sesame.sailimpl.rdbms.TableNames
ADDED_TRIPLES_TABLE, ALL_INFERRED_TABLE, ALL_NEW_TRIPLES_TABLE, CLASS_TABLE, DEPEND_TABLE, DIRECT_SUBCLASSOF_TABLE, DIRECT_SUBPROPERTYOF_TABLE, DOMAIN_TABLE, EXPIRED_LITERALS_TABLE, EXPIRED_RESOURCES_TABLE, EXPIRED_TRIPLES_TABLE, EXPIRED_VALUES_TABLE, GROUNDED_TRIPLES_TABLE, INFERRED_TABLE, INSTANCEOF_TABLE, LITERALS_TABLE, NAMESPACES_TABLE, NEW_GROUNDED_TRIPLES_TABLE, NEW_TRIPLES_TABLE, PROPER_INSTANCEOF_TABLE, PROPERTY_TABLE, RANGE_TABLE, RAW_TRIPLES_TABLE, REP_INFO_TABLE, RESOURCES_TABLE, SUBCLASSOF_TABLE, SUBPROPERTYOF_TABLE, TRIPLES_TABLE
 
Constructor Summary
RdfSchemaRepository()
           
 
Method Summary
 void clearRepository()
          Clears the repository.
 StatementIterator getClasses()
          Gets all defined classes.
 StatementIterator getDirectSubClassOf(Resource subClass, Resource superClass)
          Gets all direct subClassOf relations with a specific sub- and/or superclass.
 StatementIterator getDirectSubPropertyOf(Resource subProperty, Resource superProperty)
          Gets all direct subPropertyOf relations with a specific sub- and/or superproperty.
 StatementIterator getDirectType(Resource anInstance, Resource aClass)
          Gets all direct type relations with a specific instance and/or class.
 StatementIterator getDomain(Resource prop, Resource domain)
          Gets all domain relations with a specific property and/or domain class.
 StatementIterator getExplicitStatements(Resource subj, URI pred, Value obj)
          Gets all explicitly added statements with a specific subject, predicate and/or object.
 LiteralIterator getLiterals(String label, String language, URI datatype)
          Gets all literals with a specific label, language and/or datatype.
 StatementIterator getProperties()
          Gets all defined properties.
 StatementIterator getRange(Resource prop, Resource domain)
          Gets all range relations with a specific property and/or range class.
 RDBMS getRDBMS()
           
 StatementIterator getSubClassOf(Resource subClass, Resource superClass)
          Gets all subClassOf relations with a specific sub- and/or superclass.
 StatementIterator getSubPropertyOf(Resource subProperty, Resource superProperty)
          Gets all subPropertyOf relations with a specific sub- and/or superproperty.
 StatementIterator getType(Resource anInstance, Resource aClass)
          Gets all type relations with a specific instance and/or class.
 boolean hasExplicitStatement(Resource subj, URI pred, Value obj)
          Checks if an explicitly added statement with a specific subject, predicate and/or object is present in the repository.
 void initialize(Map configParams)
          Initializes the Sail using a set of configuration parameters.
 boolean isClass(Resource resource)
          Checks whether the supplied resource represents a class.
 boolean isDirectSubClassOf(Resource subClass, Resource superClass)
          Checks whether one resource is a direct subclass of another.
 boolean isDirectSubPropertyOf(Resource subProperty, Resource superProperty)
          Checks whether one resource is a direct subproperty of another.
 boolean isDirectType(Resource anInstance, Resource aClass)
          Checks whether one resource is a direct instance of another.
 boolean isProperty(Resource resource)
          Checks whether the supplied resource represents a property.
 boolean isSubClassOf(Resource subClass, Resource superClass)
          Checks whether one resource is a subclass of another.
 boolean isSubPropertyOf(Resource subProperty, Resource superProperty)
          Checks whether one resource is a subproperty of another.
 boolean isType(Resource anInstance, Resource aClass)
          Checks whether one resource is an instance of another.
 
Methods inherited from class org.openrdf.sesame.sailimpl.rdbms.RdfRepository
addListener, addStatement, changeNamespacePrefix, commitTransaction, removeListener, removeStatements, startTransaction, transactionStarted
 
Methods inherited from class org.openrdf.sesame.sailimpl.rdbms.RdfSource
createBNode, createBNode, createLiteral, createLiteral, createLiteral, createStatement, createURI, createURI, getLiteral, getNamespaces, getResource, getStatements, getStatements, getValue, getValueFactory, hasStatement, hasStatement, initialize, initialize, optimizeQuery, shutDown
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openrdf.sesame.sail.RdfSource
getNamespaces, getStatements, getValueFactory, hasStatement, optimizeQuery
 
Methods inherited from interface org.openrdf.sesame.sail.Sail
shutDown
 
Methods inherited from interface org.openrdf.sesame.sail.RdfRepository
addListener, addStatement, changeNamespacePrefix, commitTransaction, removeListener, removeStatements, startTransaction, transactionStarted
 

Field Detail

INFERENCER_KEY

public static final String INFERENCER_KEY
Key used to store a fully qualified inferencer class name in the initialization parameters.

See Also:
Constant Field Values

USE_DEPENDENCY_INFERENCER_KEY

public static final String USE_DEPENDENCY_INFERENCER_KEY
See Also:
Constant Field Values

rdfTypeId

public int rdfTypeId

rdfPropertyId

public int rdfPropertyId

rdfXMLLiteralId

public int rdfXMLLiteralId

rdfStatementId

public int rdfStatementId

rdfSubjectId

public int rdfSubjectId

rdfPredicateId

public int rdfPredicateId

rdfObjectId

public int rdfObjectId

rdfAltId

public int rdfAltId

rdfBagId

public int rdfBagId

rdfSeqId

public int rdfSeqId

rdfListId

public int rdfListId

rdfFirstId

public int rdfFirstId

rdfRestId

public int rdfRestId

rdfNilId

public int rdfNilId

rdfValueId

public int rdfValueId

rdfsResourceId

public int rdfsResourceId

rdfsLiteralId

public int rdfsLiteralId

rdfsClassId

public int rdfsClassId

rdfsSubClassOfId

public int rdfsSubClassOfId

rdfsSubPropertyOfId

public int rdfsSubPropertyOfId

rdfsDomainId

public int rdfsDomainId

rdfsRangeId

public int rdfsRangeId

rdfsCommentId

public int rdfsCommentId

rdfsLabelId

public int rdfsLabelId

rdfsDatatypeId

public int rdfsDatatypeId

rdfsContainerId

public int rdfsContainerId

rdfsMemberId

public int rdfsMemberId

rdfsContainerMembershipPropertyId

public int rdfsContainerMembershipPropertyId

rdfsIsDefinedById

public int rdfsIsDefinedById

rdfsSeeAlsoId

public int rdfsSeeAlsoId
Constructor Detail

RdfSchemaRepository

public RdfSchemaRepository()
Method Detail

initialize

public void initialize(Map configParams)
                throws SailInitializationException
Description copied from interface: Sail
Initializes the Sail using a set of configuration parameters. The relevant names and values of the parameters are determined by the implementation of the interface.

Specified by:
initialize in interface Sail
Overrides:
initialize in class RdfRepository
Throws:
SailInitializationException
See Also:
Sail.initialize(java.util.Map)

clearRepository

public void clearRepository()
                     throws SailUpdateException
Description copied from interface: RdfRepository
Clears the repository. After the repository was cleared, it will be in the same state as after initialization. You must start a transaction before this method can be used.

Specified by:
clearRepository in interface RdfRepository
Overrides:
clearRepository in class RdfRepository
Throws:
SailUpdateException

getExplicitStatements

public StatementIterator getExplicitStatements(Resource subj,
                                               URI pred,
                                               Value obj)
Description copied from interface: RdfSchemaSource
Gets all explicitly added statements with a specific subject, predicate and/or object. All of these parameters may be null to indicate wildcards.

Specified by:
getExplicitStatements in interface RdfSchemaSource
Parameters:
subj - subject of pattern
pred - predicate of pattern
obj - object of pattern
Returns:
iterator over statements
See Also:
RdfSource.getStatements(org.openrdf.model.Resource, org.openrdf.model.URI, org.openrdf.model.Value)

hasExplicitStatement

public boolean hasExplicitStatement(Resource subj,
                                    URI pred,
                                    Value obj)
Description copied from interface: RdfSchemaSource
Checks if an explicitly added statement with a specific subject, predicate and/or object is present in the repository. All of these parameters may be null to indicate wildcards.

Specified by:
hasExplicitStatement in interface RdfSchemaSource
Parameters:
subj - subject of statement
pred - predicate of statement
obj - object of statement
Returns:
boolean indicating if the specified statement is present.
See Also:
RdfSource.hasStatement(org.openrdf.model.Resource, org.openrdf.model.URI, org.openrdf.model.Value)

getClasses

public StatementIterator getClasses()
Description copied from interface: RdfSchemaSource
Gets all defined classes.

Specified by:
getClasses in interface RdfSchemaSource
Returns:
A StatementIterator containing statements of the form (someClass, rdf:type, rdfs:Class).

isClass

public boolean isClass(Resource resource)
Description copied from interface: RdfSchemaSource
Checks whether the supplied resource represents a class.

Specified by:
isClass in interface RdfSchemaSource
Parameters:
resource - A resource
Returns:
true if resource is a class, false otherwise.

getProperties

public StatementIterator getProperties()
Description copied from interface: RdfSchemaSource
Gets all defined properties.

Specified by:
getProperties in interface RdfSchemaSource
Returns:
A StatementIterator containing statements of the form (someProperty, rdf:type, rdf:Property).

isProperty

public boolean isProperty(Resource resource)
Description copied from interface: RdfSchemaSource
Checks whether the supplied resource represents a property.

Specified by:
isProperty in interface RdfSchemaSource
Parameters:
resource - A resource
Returns:
true if resource is a property, false otherwise.

getSubClassOf

public StatementIterator getSubClassOf(Resource subClass,
                                       Resource superClass)
Description copied from interface: RdfSchemaSource
Gets all subClassOf relations with a specific sub- and/or superclass. Note that the subClassOf relation is reflexive: a class is implicitly always a subclass of itself.

Specified by:
getSubClassOf in interface RdfSchemaSource
Parameters:
subClass - The subclass of the relations that should be returned, or null if relations with any subclass should be returned.
superClass - The superclass of the relations that should be returned, or null if relations with any superclass should be returned.
Returns:
A StatementIterator containing statements of the form (someSubClass, rdfs:subClassOf, someSuperClass).

getDirectSubClassOf

public StatementIterator getDirectSubClassOf(Resource subClass,
                                             Resource superClass)
Description copied from interface: RdfSchemaSource
Gets all direct subClassOf relations with a specific sub- and/or superclass. A class A is a direct subclass of class B if there is no class C such that A is a subclass of C and C is a subclass of B.

Specified by:
getDirectSubClassOf in interface RdfSchemaSource
Parameters:
subClass - The subclass of the relations that should be returned, or null if relations with any subclass should be returned.
superClass - The superclass of the relations that should be returned, or null if relations with any superclass should be returned.
Returns:
A StatementIterator containing statements of the form (someSubClass, rdfs:subClassOf, someSuperClass).

isSubClassOf

public boolean isSubClassOf(Resource subClass,
                            Resource superClass)
Description copied from interface: RdfSchemaSource
Checks whether one resource is a subclass of another.

Specified by:
isSubClassOf in interface RdfSchemaSource
Parameters:
subClass - A class
superClass - A class
Returns:
true if subClass is a subclass of superClass, false otherwise.

isDirectSubClassOf

public boolean isDirectSubClassOf(Resource subClass,
                                  Resource superClass)
Description copied from interface: RdfSchemaSource
Checks whether one resource is a direct subclass of another.

Specified by:
isDirectSubClassOf in interface RdfSchemaSource
Parameters:
subClass - A class
superClass - A class
Returns:
true if subClass is a direct subclass of superClass, false otherwise.

getSubPropertyOf

public StatementIterator getSubPropertyOf(Resource subProperty,
                                          Resource superProperty)
Description copied from interface: RdfSchemaSource
Gets all subPropertyOf relations with a specific sub- and/or superproperty. Note that the subPropertyOf relation is reflexive: a property is implicitly always a subproperty of itself.

Specified by:
getSubPropertyOf in interface RdfSchemaSource
Parameters:
subProperty - The subproperty of the relations that should be returned, or null if relations with any subproperty should be returned.
superProperty - The superproperty of the relations that should be returned, or null if relations with any superproperty should be returned.
Returns:
A StatementIterator containing statements of the form (someSubProperty, rdfs:subPropertyOf, someSuperProperty).

getDirectSubPropertyOf

public StatementIterator getDirectSubPropertyOf(Resource subProperty,
                                                Resource superProperty)
Description copied from interface: RdfSchemaSource
Gets all direct subPropertyOf relations with a specific sub- and/or superproperty. A property A is a direct subproperty of property B if there is no property C such that A is a subproperty of C and C is a subproperty of B.

Specified by:
getDirectSubPropertyOf in interface RdfSchemaSource
Parameters:
subProperty - The subproperty of the relations that should be returned, or null if relations with any subproperty should be returned.
superProperty - The superproperty of the relations that should be returned, or null if relations with any superproperty should be returned.
Returns:
A StatementIterator containing statements of the form (someSubProperty, rdfs:subPropertyOf, someSuperProperty).

isSubPropertyOf

public boolean isSubPropertyOf(Resource subProperty,
                               Resource superProperty)
Description copied from interface: RdfSchemaSource
Checks whether one resource is a subproperty of another.

Specified by:
isSubPropertyOf in interface RdfSchemaSource
Parameters:
subProperty - A property
superProperty - A property
Returns:
true if subProperty is a subproperty of superProperty, false otherwise.

isDirectSubPropertyOf

public boolean isDirectSubPropertyOf(Resource subProperty,
                                     Resource superProperty)
Description copied from interface: RdfSchemaSource
Checks whether one resource is a direct subproperty of another.

Specified by:
isDirectSubPropertyOf in interface RdfSchemaSource
Parameters:
subProperty - A property
superProperty - A property
Returns:
true if subProperty is a direct subproperty of superProperty, false otherwise.

getDomain

public StatementIterator getDomain(Resource prop,
                                   Resource domain)
Description copied from interface: RdfSchemaSource
Gets all domain relations with a specific property and/or domain class.

Specified by:
getDomain in interface RdfSchemaSource
Parameters:
prop - The property of the relations that should be returned, or null if relations with any property should be returned.
domain - The domain of the relations that should be returned, or null if relations with any domain should be returned.
Returns:
A StatementIterator containing statements of the form (someProperty, rdfs:domain, someClass).

getRange

public StatementIterator getRange(Resource prop,
                                  Resource domain)
Description copied from interface: RdfSchemaSource
Gets all range relations with a specific property and/or range class.

Specified by:
getRange in interface RdfSchemaSource
Parameters:
prop - The property of the relations that should be returned, or null if relations with any property should be returned.
domain - The range of the relations that should be returned, or null if relations with any range should be returned.
Returns:
A StatementIterator containing statements of the form (someProperty, rdfs:range, someClass).

getType

public StatementIterator getType(Resource anInstance,
                                 Resource aClass)
Description copied from interface: RdfSchemaSource
Gets all type relations with a specific instance and/or class.

Specified by:
getType in interface RdfSchemaSource
Parameters:
anInstance - The instance of the relations that should be returned, or null if relations with any instance should be returned.
aClass - The class of the relations that should be returned, or null if relations with any class should be returned.
Returns:
A StatementIterator containing statements of the form (someInstance, rdf:type, someClass).

getDirectType

public StatementIterator getDirectType(Resource anInstance,
                                       Resource aClass)
Description copied from interface: RdfSchemaSource
Gets all direct type relations with a specific instance and/or class.

Specified by:
getDirectType in interface RdfSchemaSource
Parameters:
anInstance - The instance of the relations that should be returned, or null if relations with any instance should be returned.
aClass - The class of the relations that should be returned, or null if relations with any class should be returned.
Returns:
A StatementIterator containing statements of the form (someInstance, rdf:type, someClass).

isType

public boolean isType(Resource anInstance,
                      Resource aClass)
Description copied from interface: RdfSchemaSource
Checks whether one resource is an instance of another.

Specified by:
isType in interface RdfSchemaSource
Parameters:
anInstance - An instance
aClass - A class
Returns:
true if anInstance is a instance of aClass, false otherwise.

isDirectType

public boolean isDirectType(Resource anInstance,
                            Resource aClass)
Description copied from interface: RdfSchemaSource
Checks whether one resource is a direct instance of another.

Specified by:
isDirectType in interface RdfSchemaSource
Parameters:
anInstance - An instance
aClass - A class
Returns:
true if anInstance is a direct instance of aClass, false otherwise.

getLiterals

public LiteralIterator getLiterals(String label,
                                   String language,
                                   URI datatype)
Description copied from interface: RdfSchemaSource
Gets all literals with a specific label, language and/or datatype.

Specified by:
getLiterals in interface RdfSchemaSource
Parameters:
label - The label of the literals that should be returned, or null if literals with any label should be returned.
language - The language of the literals that should be returned, or null if literals with any language should be returned.
datatype - The datatype of the literals that should be returned, or null if literals with any datatype should be returned.
Returns:
A LiteralIterator containing literals that match the specified pattern.

getRDBMS

public RDBMS getRDBMS()


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.