|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.impl.empire.model.ReasoningServiceImpl.ReasoningTaskBase
info.sswap.impl.empire.model.ReasoningServiceImpl.IndividualTranslator
private class ReasoningServiceImpl.IndividualTranslator
Translates an individual into using the vocabulary used by the specified class. (The individual must belong to that class.) This kind of translation is performed when the individual belongs to a more specific class, which could have created its own vocabulary (e.g., by creating subProperties or by using subclasses for values of properties), and we want to express that individual using the concepts/classes of a more generic class. An example of a use case when such a situation happens is when a client sends an RIG to the provider, and that RIG can use concepts different than the original RDG. This class will validate and translate all properties for that individual back into using the RDG terminology.
Nested Class Summary | |
---|---|
private class |
ReasoningServiceImpl.IndividualTranslator.TranslationCache
Contains cache of translation results. |
Nested classes/interfaces inherited from class info.sswap.impl.empire.model.ReasoningServiceImpl.ReasoningTaskBase |
---|
ReasoningServiceImpl.ReasoningTaskBase.ClassIndividualMapping |
Field Summary | |
---|---|
private ReasoningServiceImpl.IndividualTranslator.TranslationCache |
cache
A cache for already translated concepts. |
private java.util.Stack<java.lang.String> |
classExplanationStack
Stack of named classes that represents the dependencies between named classes being translated. |
private com.hp.hpl.jena.rdf.model.Model |
model
The model where the translated concepts will be stored. |
Constructor Summary | |
---|---|
private |
ReasoningServiceImpl.IndividualTranslator()
|
Method Summary | |
---|---|
private void |
assertContainsTriple(java.lang.String subject,
java.lang.String predicate,
java.lang.String object)
Asserts that the underlying ont model contains the specified triple. |
private boolean |
containsTriple(java.lang.String subject,
java.lang.String predicate,
java.lang.String object)
Checks whether the underlying ontModel contains the specified triple |
private com.hp.hpl.jena.rdf.model.Statement |
createTriple(java.lang.String subject,
java.lang.String predicate,
java.lang.String object)
Creates a triple. |
com.hp.hpl.jena.rdf.model.Model |
getTranslatedModel(aterm.ATermAppl clazz,
aterm.ATermAppl individual)
Creates a Jena model with translated information for the individual |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translate(aterm.ATermAppl clazz,
aterm.ATermAppl individual)
Translates the individual into the vocabulary used by the specified class |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateAllValues(aterm.ATermAppl allValues,
aterm.ATermAppl individual)
Translates an owl:allValuesFrom restriction and the property referenced in it. |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateCard(aterm.ATermAppl card,
aterm.ATermAppl individual)
Translates an owl:cardinality restriction for the individual, and the property referenced in it |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateCardinality(aterm.ATermAppl individual,
aterm.ATermAppl property,
int n,
aterm.ATermAppl rangeRestriction,
boolean enforceRange)
Translates a minimum cardinality constraint, and the property referenced in it |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateComplementOf(aterm.ATermAppl complement,
aterm.ATermAppl individual)
Translates an owl:complementOf |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateDomain(aterm.ATermAppl role,
aterm.ATermAppl individual)
|
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateIntersectionOf(aterm.ATermAppl intersection,
aterm.ATermAppl individual)
Translates an owl:intersectionOf |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateMax(aterm.ATermAppl max,
aterm.ATermAppl individual)
Translates owl:maxCardinality restriction for the individual and the property referenced in it |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateMin(aterm.ATermAppl min,
aterm.ATermAppl individual)
Translates an owl:minCardinality restriction and the property referenced in it |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateNamedClass(aterm.ATermAppl namedClass,
aterm.ATermAppl individual)
Translates a named class expression (this includes both named classes and intersections/unions/complements that got assigned a special bnode URI). |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateSelf(aterm.ATermAppl self,
aterm.ATermAppl individual)
Translates owl:hasSelf restriction for the individual and the property referenced in it |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateSomeValues(aterm.ATermAppl someValues,
aterm.ATermAppl individual)
Translates an owl:someValuesFrom restriction and the property referenced in it. |
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> |
translateUnionOf(aterm.ATermAppl union,
aterm.ATermAppl individual)
Translates an owl:unionOf |
private void |
validateNone(aterm.ATermAppl individual,
aterm.ATermAppl property)
Validate that there are no values for the property and individual. |
Methods inherited from class info.sswap.impl.empire.model.ReasoningServiceImpl.ReasoningTaskBase |
---|
getDomains, getEquivalentClasses, getRanges, getSuperClasses, getTBoxAxioms |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private com.hp.hpl.jena.rdf.model.Model model
private ReasoningServiceImpl.IndividualTranslator.TranslationCache cache
private java.util.Stack<java.lang.String> classExplanationStack
Constructor Detail |
---|
private ReasoningServiceImpl.IndividualTranslator()
Method Detail |
---|
public com.hp.hpl.jena.rdf.model.Model getTranslatedModel(aterm.ATermAppl clazz, aterm.ATermAppl individual) throws ValidationException
clazz
- the class to which the individual should belong (and whose terms should be used)individual
- the individual whose information should be translated.
ValidationException
- if the individual does not conform to the restrictions defined in the specified classprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translate(aterm.ATermAppl clazz, aterm.ATermAppl individual) throws ValidationException
clazz
- the class to which the individual should belongindividual
- the individual to be translated
ValidationException
- if the individual does not belong to the class (e.g., it violates a restriction on a property)private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateNamedClass(aterm.ATermAppl namedClass, aterm.ATermAppl individual) throws ValidationException
namedClass
- the named class expressionindividual
- the individual that should belong that class expression
ValidationException
- if the individual does not belong to this classprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateIntersectionOf(aterm.ATermAppl intersection, aterm.ATermAppl individual) throws ValidationException
intersection
- the intersection of class expressionsindividual
- the individual that should satisfy all expressions in the intersection
ValidationException
- if the individual does not satisfy one or more class expressionsprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateUnionOf(aterm.ATermAppl union, aterm.ATermAppl individual) throws ValidationException
union
- the union of class expressionsindividual
- the individual that should satisfy all expressions in the intersection
ValidationException
- if the individual does not satisfy one or more class expressionsprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateComplementOf(aterm.ATermAppl complement, aterm.ATermAppl individual) throws ValidationException
complement
- the complementindividual
- the individual that should belong to the complement
ValidationException
- if the individual does not belong to the complementprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateSomeValues(aterm.ATermAppl someValues, aterm.ATermAppl individual) throws ValidationException
someValues
- the ATerm describing the restrictionindividual
- the individual that should satisfy the restriction
ValidationException
- if the individual does not satisfy the restrictionprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateAllValues(aterm.ATermAppl allValues, aterm.ATermAppl individual) throws ValidationException
allValues
- the ATerm describing the restrictionindividual
- the individual that should satisfy the restriction
ValidationException
- if the individual does not satisfy the restrictionprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateMin(aterm.ATermAppl min, aterm.ATermAppl individual) throws ValidationException
min
- the ATerm describing the restrictionindividual
- the individual that should satisfy the restriction
ValidationException
- if the individual does not satisfy the restrictionprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateMax(aterm.ATermAppl max, aterm.ATermAppl individual) throws ValidationException
max
- the ATerm describing the restrictionindividual
- the individual that should satisfy the restriction
ValidationException
- if the individual does not satisfy the restrictionprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateCard(aterm.ATermAppl card, aterm.ATermAppl individual) throws ValidationException
card
- the ATerm describing the restrictionindividual
- the individual that should satisfy the restriction
ValidationException
- if the individual does not satisfy the restrictionprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateSelf(aterm.ATermAppl self, aterm.ATermAppl individual) throws ValidationException
self
- the ATerm describing the restrictionindividual
- the individual that should satisfy the restriction
ValidationException
- if the individual does not satisfy the restrictionprivate java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateDomain(aterm.ATermAppl role, aterm.ATermAppl individual) throws ValidationException
ValidationException
private java.util.Collection<com.hp.hpl.jena.rdf.model.Statement> translateCardinality(aterm.ATermAppl individual, aterm.ATermAppl property, int n, aterm.ATermAppl rangeRestriction, boolean enforceRange) throws ValidationException
individual
- the individual for which the cardinality is verifiedproperty
- the property on which the cardinality restriction is placedn
- the minimum cardinalityrangeRestriction
- the range of the propertyenforceRange
- if true, throw Validation exception whenever there is any value that does not match the range,
otherwise only throw exception whenever the count of valid values (matching the range) violates
the cardinality restriction
ValidationException
- if the individual does not satisfy the restrictionprivate void validateNone(aterm.ATermAppl individual, aterm.ATermAppl property) throws ValidationException
individual
- the individualproperty
- the property
ValidationException
- if there are values for that property and individualprivate void assertContainsTriple(java.lang.String subject, java.lang.String predicate, java.lang.String object) throws ValidationException
subject
- the subject of the triplepredicate
- the predicate of the tripleobject
- the object of the triple
ValidationException
- if there is no such a triple in the ont model.private boolean containsTriple(java.lang.String subject, java.lang.String predicate, java.lang.String object)
subject
- the subject of the triplepredicate
- the predicate of the tripleobject
- the object of the triple
private com.hp.hpl.jena.rdf.model.Statement createTriple(java.lang.String subject, java.lang.String predicate, java.lang.String object)
subject
- subject URIpredicate
- predicate URIobject
- object URI
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |