org.openrdf.sesame.sailimpl.sync
Class SyncRdfSchemaRepository

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.sync.SyncRdfRepository
      extended byorg.openrdf.sesame.sailimpl.sync.SyncRdfSchemaRepository
All Implemented Interfaces:
RdfRepository, RdfSchemaRepository, RdfSchemaSource, RdfSource, Sail, StackedSail

public class SyncRdfSchemaRepository
extends SyncRdfRepository
implements RdfSchemaRepository, StackedSail

Version:
$Revision: 1.4.4.2 $
Author:
Arjohn Kampman

Constructor Summary
SyncRdfSchemaRepository()
           
 
Method Summary
 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 range)
          Gets all range relations with a specific property and/or range class.
 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.
 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.
 void setBaseSail(Sail sail)
          Sets the base Sail that this Sail will work on top of.
 
Methods inherited from class org.openrdf.sesame.sailimpl.sync.SyncRdfRepository
addListener, addStatement, changeNamespacePrefix, clearRepository, commitTransaction, getBaseSail, getNamespaces, getStatements, getValueFactory, hasStatement, initialize, optimizeQuery, removeListener, removeStatements, shutDown, startTransaction, transactionStarted
 
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
initialize, shutDown
 
Methods inherited from interface org.openrdf.sesame.sail.RdfRepository
addListener, addStatement, changeNamespacePrefix, clearRepository, commitTransaction, removeListener, removeStatements, startTransaction, transactionStarted
 
Methods inherited from interface org.openrdf.sesame.sail.StackedSail
getBaseSail
 

Constructor Detail

SyncRdfSchemaRepository

public SyncRdfSchemaRepository()
Method Detail

setBaseSail

public void setBaseSail(Sail sail)
Description copied from interface: StackedSail
Sets the base Sail that this Sail will work on top of. This method will be called before the initialize() method is called.

Specified by:
setBaseSail in interface StackedSail
Overrides:
setBaseSail in class SyncRdfRepository

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 range)
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.
range - 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.


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