public class DatatypeReasonerImpl extends Object implements DatatypeReasoner
Title: Datatype Reasoner Implementation
Description: Default implementation of interface DatatypeReasoner
Copyright: Copyright (c) 2009
Company: Clark & Parsia, LLC.
| Constructor and Description |
|---|
DatatypeReasonerImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAtLeast(int n,
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(Object value)
Get the canonical
ATermAppl literal representation for a value
space object |
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(Collection<aterm.ATermAppl> dataranges)
Shorthand for
DatatypeReasoner.isSatisfiable(Collection, Object) where
value == null. |
boolean |
isSatisfiable(Collection<aterm.ATermAppl> dataranges,
Object value)
Check the data ranges on a single literal node are satisfiable
(independent of other nodes).
|
boolean |
isSatisfiable(Set<Literal> nodes,
Map<Literal,Set<Literal>> neqs)
Check that the data ranges and inequalities asserted on a collection of
literal nodes are satisfiable.
|
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)
|
Iterator<?> |
valueIterator(Collection<aterm.ATermAppl> dataranges)
Get an iterator for the values of a finite datarange
|
public boolean containsAtLeast(int n,
Collection<aterm.ATermAppl> ranges)
throws UnrecognizedDatatypeException,
InvalidConstrainingFacetException,
InvalidLiteralException
DatatypeReasonercontainsAtLeast in interface DatatypeReasonern - the minimum number of elementsranges - the data ranges to intersecttrue if the intersection of ranges
contains at least n elements, false
elseUnrecognizedDatatypeExceptionInvalidConstrainingFacetExceptionInvalidLiteralExceptionpublic boolean declare(aterm.ATermAppl name)
DatatypeReasonerDatatypeReasoner.isDeclared(ATermAppl).declare in interface DatatypeReasonername - the name (normally URI) of the datatypetrue if name has not been previously
declared, false else.public aterm.ATermAppl getCanonicalRepresentation(aterm.ATermAppl literal)
throws InvalidLiteralException,
UnrecognizedDatatypeException
DatatypeReasonergetCanonicalRepresentation in interface DatatypeReasonerliteral - the literal to canonicalizeInvalidLiteralException - if the literal is not in the lexical space of the datatypeUnrecognizedDatatypeException - if the datatype is not recognizedpublic Datatype<?> getDatatype(aterm.ATermAppl uri)
DatatypeReasonergetDatatype in interface DatatypeReasoneruri - the datatype identifier (e.g., xsd:integer)Datatype if uri is recognized,
null otherwisepublic aterm.ATermAppl getLiteral(Object value)
DatatypeReasonerATermAppl literal representation for a value
space objectgetLiteral in interface DatatypeReasonervalue - Element of the value space for some datatypeATermAppl representation of valuepublic Object getValue(aterm.ATermAppl literal) throws InvalidLiteralException, UnrecognizedDatatypeException
DatatypeReasonerjava.lang.Byte.getValue in interface DatatypeReasonerliteralInvalidLiteralException - if the literal is not in the lexical space of the datatypeUnrecognizedDatatypeException - 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 datatypetrue 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 rangetrue if name is supported,
false elsepublic aterm.ATermAppl getDefinition(aterm.ATermAppl name)
DatatypeReasonernull otherwise.getDefinition in interface DatatypeReasonername - the name of the datatypenull otherwise.public boolean isSatisfiable(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 nodetrue if the conjunction of the data ranges is
satisfiable, false else.InvalidConstrainingFacetExceptionInvalidLiteralExceptionUnrecognizedDatatypeExceptionpublic boolean isSatisfiable(Collection<aterm.ATermAppl> dataranges, Object value) throws InvalidConstrainingFacetException, InvalidLiteralException, UnrecognizedDatatypeException
DatatypeReasonerisSatisfiable 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.InvalidConstrainingFacetExceptionInvalidLiteralExceptionUnrecognizedDatatypeExceptionpublic boolean isSatisfiable(Set<Literal> nodes, Map<Literal,Set<Literal>> neqs) throws InvalidConstrainingFacetException, InvalidLiteralException, UnrecognizedDatatypeException
DatatypeReasonerisSatisfiable in interface DatatypeReasonernodes - A set representing all literals with in-edges from a single
individualneqs - A map representing all literal inequality constraintstrue if the data ranges and inequalities are
satisfiable, false else.InvalidConstrainingFacetExceptionInvalidLiteralExceptionUnrecognizedDatatypeExceptionpublic boolean define(aterm.ATermAppl name,
aterm.ATermAppl datarange)
DatatypeReasonerDatatypeDefinition)define in interface DatatypeReasonername - a URI used to refer to the datatypedatarange - the datarangename is already usedpublic Collection<aterm.ATermAppl> listDataRanges()
DatatypeReasonerlistDataRanges in interface DatatypeReasonerpublic boolean validLiteral(aterm.ATermAppl typedLiteral)
throws UnrecognizedDatatypeException
DatatypeReasonervalidLiteral in interface DatatypeReasonertrue if the literal is in the lexical space of the
datatype, falseelseUnrecognizedDatatypeExceptionpublic Iterator<?> valueIterator(Collection<aterm.ATermAppl> dataranges) throws InvalidConstrainingFacetException, InvalidLiteralException, UnrecognizedDatatypeException
DatatypeReasonervalueIterator in interface DatatypeReasonerdataranges - the data rangesIteratorInvalidConstrainingFacetException - if dataranges contains a datatype restriction in
which the constraining facet is not validInvalidLiteralException - if dataranges references a literal value that is
invalidUnrecognizedDatatypeException - if dataranges references an unrecognized
datatypeCopyright © 2019. All rights reserved.