org.openrdf.sesame.sail
Interface RdfSchemaSource

All Superinterfaces:
RdfSource, Sail
All Known Subinterfaces:
RdfSchemaRepository
All Known Implementing Classes:
RdfSchemaRepository, RdfSchemaRepository, SecuritySail, SyncRdfSchemaRepository

public interface RdfSchemaSource
extends RdfSource

An extension of RdfSource offering RDF Schema specific methods.

Version:
$Revision: 1.3.4.2 $
Author:
Arjohn Kampman

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

Method Detail

getExplicitStatements

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

Parameters:
subj - subject of pattern
pred - predicate of pattern
obj - object of pattern
Returns:
iterator over statements
Throws:
SailInternalException - To indicate an internal error.
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)
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.

Parameters:
subj - subject of statement
pred - predicate of statement
obj - object of statement
Returns:
boolean indicating if the specified statement is present.
Throws:
SailInternalException - To indicate an internal error.
See Also:
RdfSource.hasStatement(org.openrdf.model.Resource, org.openrdf.model.URI, org.openrdf.model.Value)

getClasses

public StatementIterator getClasses()
Gets all defined classes.

Returns:
A StatementIterator containing statements of the form (someClass, rdf:type, rdfs:Class).
Throws:
SailInternalException - To indicate an internal error.

isClass

public boolean isClass(Resource resource)
Checks whether the supplied resource represents a class.

Parameters:
resource - A resource
Returns:
true if resource is a class, false otherwise.
Throws:
SailInternalException - To indicate an internal error.

getProperties

public StatementIterator getProperties()
Gets all defined properties.

Returns:
A StatementIterator containing statements of the form (someProperty, rdf:type, rdf:Property).
Throws:
SailInternalException - To indicate an internal error.

isProperty

public boolean isProperty(Resource resource)
Checks whether the supplied resource represents a property.

Parameters:
resource - A resource
Returns:
true if resource is a property, false otherwise.
Throws:
SailInternalException - To indicate an internal error.

getSubClassOf

public StatementIterator getSubClassOf(Resource subClass,
                                       Resource superClass)
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.

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).
Throws:
SailInternalException - To indicate an internal error.

getDirectSubClassOf

public StatementIterator getDirectSubClassOf(Resource subClass,
                                             Resource superClass)
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.

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).
Throws:
SailInternalException - To indicate an internal error.

isSubClassOf

public boolean isSubClassOf(Resource subClass,
                            Resource superClass)
Checks whether one resource is a subclass of another.

Parameters:
subClass - A class
superClass - A class
Returns:
true if subClass is a subclass of superClass, false otherwise.
Throws:
SailInternalException - To indicate an internal error.

isDirectSubClassOf

public boolean isDirectSubClassOf(Resource subClass,
                                  Resource superClass)
Checks whether one resource is a direct subclass of another.

Parameters:
subClass - A class
superClass - A class
Returns:
true if subClass is a direct subclass of superClass, false otherwise.
Throws:
SailInternalException - To indicate an internal error.

getSubPropertyOf

public StatementIterator getSubPropertyOf(Resource subProperty,
                                          Resource superProperty)
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.

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).
Throws:
SailInternalException - To indicate an internal error.

getDirectSubPropertyOf

public StatementIterator getDirectSubPropertyOf(Resource subProperty,
                                                Resource superProperty)
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.

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).
Throws:
SailInternalException - To indicate an internal error.

isSubPropertyOf

public boolean isSubPropertyOf(Resource subProperty,
                               Resource superProperty)
Checks whether one resource is a subproperty of another.

Parameters:
subProperty - A property
superProperty - A property
Returns:
true if subProperty is a subproperty of superProperty, false otherwise.
Throws:
SailInternalException - To indicate an internal error.

isDirectSubPropertyOf

public boolean isDirectSubPropertyOf(Resource subProperty,
                                     Resource superProperty)
Checks whether one resource is a direct subproperty of another.

Parameters:
subProperty - A property
superProperty - A property
Returns:
true if subProperty is a direct subproperty of superProperty, false otherwise.
Throws:
SailInternalException - To indicate an internal error.

getDomain

public StatementIterator getDomain(Resource prop,
                                   Resource domain)
Gets all domain relations with a specific property and/or domain class.

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).
Throws:
SailInternalException - To indicate an internal error.

getRange

public StatementIterator getRange(Resource prop,
                                  Resource range)
Gets all range relations with a specific property and/or range class.

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).
Throws:
SailInternalException - To indicate an internal error.

getType

public StatementIterator getType(Resource anInstance,
                                 Resource aClass)
Gets all type relations with a specific instance and/or class.

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).
Throws:
SailInternalException - To indicate an internal error.

getDirectType

public StatementIterator getDirectType(Resource anInstance,
                                       Resource aClass)
Gets all direct type relations with a specific instance and/or class.

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).
Throws:
SailInternalException - To indicate an internal error.

isType

public boolean isType(Resource anInstance,
                      Resource aClass)
Checks whether one resource is an instance of another.

Parameters:
anInstance - An instance
aClass - A class
Returns:
true if anInstance is a instance of aClass, false otherwise.
Throws:
SailInternalException - To indicate an internal error.

isDirectType

public boolean isDirectType(Resource anInstance,
                            Resource aClass)
Checks whether one resource is a direct instance of another.

Parameters:
anInstance - An instance
aClass - A class
Returns:
true if anInstance is a direct instance of aClass, false otherwise.
Throws:
SailInternalException - To indicate an internal error.

getLiterals

public LiteralIterator getLiterals(String label,
                                   String language,
                                   URI datatype)
Gets all literals with a specific label, language and/or datatype.

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.
Throws:
SailInternalException - To indicate an internal error.


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