|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.clarkparsia.pellet.datatypes.DatatypeReasonerImpl
public class DatatypeReasonerImpl
Title: Datatype Reasoner Implementation
Description: Default implementation of interface DatatypeReasoner
Copyright: Copyright (c) 2009
Company: Clark & Parsia, LLC.
| Constructor Summary | |
|---|---|
DatatypeReasonerImpl()
|
|
| Method Summary | |
|---|---|
boolean |
containsAtLeast(int n,
java.util.Collection<aterm.ATermAppl> ranges)
Check that the intersection of a collection of data ranges contains a minimum number of elements. |
boolean |
declare(aterm.ATermAppl name)
Declare a named datatype. |
boolean |
define(aterm.ATermAppl name,
aterm.ATermAppl datarange)
Name a data range (see OWL 2 DatatypeDefinition) |
aterm.ATermAppl |
getCanonicalRepresentation(aterm.ATermAppl literal)
Get the canonical representation of a literal. |
Datatype<?> |
getDatatype(aterm.ATermAppl uri)
Get the datatype identified by a uri |
aterm.ATermAppl |
getDefinition(aterm.ATermAppl name)
Returns the definition for the given datatype name if it is defined, or null otherwise. |
aterm.ATermAppl |
getLiteral(java.lang.Object value)
Get the canonical ATermAppl literal representation for a value
space object |
java.lang.Object |
getValue(aterm.ATermAppl literal)
Get the Java object representation of the data value. |
boolean |
isDeclared(aterm.ATermAppl name)
Check if a specific datatype or named data range has been declared. |
boolean |
isDefined(aterm.ATermAppl name)
Check if a specific datatype or named data range can be supported by the datatype reasoner. |
boolean |
isSatisfiable(java.util.Collection<aterm.ATermAppl> dataranges)
Shorthand for DatatypeReasoner.isSatisfiable(Collection, Object) where
value == null. |
boolean |
isSatisfiable(java.util.Collection<aterm.ATermAppl> dataranges,
java.lang.Object value)
Check the data ranges on a single literal node are satisfiable (independent of other nodes). |
boolean |
isSatisfiable(java.util.Set<Literal> nodes,
java.util.Map<Literal,java.util.Set<Literal>> neqs)
Check that the data ranges and inequalities asserted on a collection of literal nodes are satisfiable. |
java.util.Collection<aterm.ATermAppl> |
listDataRanges()
Return a collection of all known data ranges. |
boolean |
validLiteral(aterm.ATermAppl typedLiteral)
Check if a typed literal is valid (i.e., it is in the lexical space for its datatype) |
java.util.Iterator<?> |
valueIterator(java.util.Collection<aterm.ATermAppl> dataranges)
Get an iterator for the values of a finite datarange |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DatatypeReasonerImpl()
| Method Detail |
|---|
public boolean containsAtLeast(int n,
java.util.Collection<aterm.ATermAppl> ranges)
throws UnrecognizedDatatypeException,
InvalidConstrainingFacetException,
InvalidLiteralException
DatatypeReasoner
containsAtLeast in interface DatatypeReasonern - the minimum number of elementsranges - the data ranges to intersect
true if the intersection of ranges
contains at least n elements, false
else
UnrecognizedDatatypeException
InvalidConstrainingFacetException
InvalidLiteralExceptionpublic boolean declare(aterm.ATermAppl name)
DatatypeReasonerDatatypeReasoner.isDeclared(ATermAppl).
declare in interface DatatypeReasonername - the name (normally URI) of the datatype
true if name has not been previously
declared, false else.
public aterm.ATermAppl getCanonicalRepresentation(aterm.ATermAppl literal)
throws InvalidLiteralException,
UnrecognizedDatatypeException
DatatypeReasoner
getCanonicalRepresentation in interface DatatypeReasonerliteral - the literal to canonicalize
InvalidLiteralException - if the literal is not in the lexical space of the datatype
UnrecognizedDatatypeException - if the datatype is not recognizedpublic Datatype<?> getDatatype(aterm.ATermAppl uri)
DatatypeReasoner
getDatatype in interface DatatypeReasoneruri - the datatype identifier (e.g., xsd:integer)
Datatype if uri is recognized,
null otherwisepublic aterm.ATermAppl getLiteral(java.lang.Object value)
DatatypeReasonerATermAppl literal representation for a value
space object
getLiteral in interface DatatypeReasonervalue - Element of the value space for some datatype
ATermAppl representation of value
public java.lang.Object getValue(aterm.ATermAppl literal)
throws InvalidLiteralException,
UnrecognizedDatatypeException
DatatypeReasonerjava.lang.Byte.
getValue in interface DatatypeReasonerliteral
InvalidLiteralException - if the literal is not in the lexical space of the datatype
UnrecognizedDatatypeException - if the datatype is not recognizedpublic boolean isDeclared(aterm.ATermAppl name)
DatatypeReasonerxsd:integer)DatatypeReasoner.declare(ATermAppl), which typically precedes a
call to DatatypeReasoner.define(ATermAppl, ATermAppl)DatatypeReasoner.define(ATermAppl, ATermAppl)
isDeclared in interface DatatypeReasonername - the name (normally URI) of the datatype
true if name has been declared,
false
elsepublic boolean isDefined(aterm.ATermAppl name)
DatatypeReasonername parameter of a call
DatatypeReasoner.define(ATermAppl, ATermAppl)
isDefined in interface DatatypeReasonername - the name (normally URI) of the datatype or named data range
true if name is supported,
false elsepublic aterm.ATermAppl getDefinition(aterm.ATermAppl name)
DatatypeReasonernull otherwise.
getDefinition in interface DatatypeReasonername - the name of the datatype
null otherwise.
public boolean isSatisfiable(java.util.Collection<aterm.ATermAppl> dataranges)
throws InvalidConstrainingFacetException,
InvalidLiteralException,
UnrecognizedDatatypeException
DatatypeReasonerDatatypeReasoner.isSatisfiable(Collection, Object) where
value == null.
isSatisfiable in interface DatatypeReasonerdataranges - The data ranges on the literal node
true if the conjunction of the data ranges is
satisfiable, false else.
InvalidConstrainingFacetException
InvalidLiteralException
UnrecognizedDatatypeException
public boolean isSatisfiable(java.util.Collection<aterm.ATermAppl> dataranges,
java.lang.Object value)
throws InvalidConstrainingFacetException,
InvalidLiteralException,
UnrecognizedDatatypeException
DatatypeReasoner
isSatisfiable in interface DatatypeReasonervalue - A constant value asserted for the node or null if
no such value is present.
true if the conjunction of the data ranges is
satisfiable, false else.
InvalidConstrainingFacetException
InvalidLiteralException
UnrecognizedDatatypeException
public boolean isSatisfiable(java.util.Set<Literal> nodes,
java.util.Map<Literal,java.util.Set<Literal>> neqs)
throws InvalidConstrainingFacetException,
InvalidLiteralException,
UnrecognizedDatatypeException
DatatypeReasoner
isSatisfiable in interface DatatypeReasonernodes - A set representing all literals with in-edges from a single
individualneqs - A map representing all literal inequality constraints
true if the data ranges and inequalities are
satisfiable, false else.
InvalidConstrainingFacetException
InvalidLiteralException
UnrecognizedDatatypeException
public boolean define(aterm.ATermAppl name,
aterm.ATermAppl datarange)
DatatypeReasonerDatatypeDefinition)
define in interface DatatypeReasonername - a URI used to refer to the datatypedatarange - the datarange
name is already usedpublic java.util.Collection<aterm.ATermAppl> listDataRanges()
DatatypeReasoner
listDataRanges in interface DatatypeReasoner
public boolean validLiteral(aterm.ATermAppl typedLiteral)
throws UnrecognizedDatatypeException
DatatypeReasoner
validLiteral in interface DatatypeReasonertrue if the literal is in the lexical space of the
datatype, falseelse
UnrecognizedDatatypeException
public java.util.Iterator<?> valueIterator(java.util.Collection<aterm.ATermAppl> dataranges)
throws InvalidConstrainingFacetException,
InvalidLiteralException,
UnrecognizedDatatypeException
DatatypeReasoner
valueIterator in interface DatatypeReasonerdataranges - the data ranges
Iterator
InvalidConstrainingFacetException - if dataranges contains a datatype restriction in
which the constraining facet is not valid
InvalidLiteralException - if dataranges references a literal value that is
invalid
UnrecognizedDatatypeException - if dataranges references an unrecognized
datatype
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||