info.sswap.impl.empire.model
Class ReasoningServiceImpl

java.lang.Object
  extended by info.sswap.impl.empire.model.ReasoningServiceImpl
All Implemented Interfaces:
ReasoningService

public class ReasoningServiceImpl
extends java.lang.Object
implements ReasoningService

Implementation of the reasoning service for a Jena model.

Author:
Blazej Bulka

Nested Class Summary
static class ReasoningServiceImpl.ExplanationSyntax
           
private  class ReasoningServiceImpl.IndividualTranslator
          Translates an individual into using the vocabulary used by the specified class.
(package private) static class ReasoningServiceImpl.PropertyInformation
          An entry for caching information about a property so that we do not have to query the reasoner repeatedly about properties.
static class ReasoningServiceImpl.PropertyType
          An enum for storing a type of a property (datatype vs object or undefined)
private  class ReasoningServiceImpl.ReasoningTaskBase
           
 
Field Summary
private  boolean automaticTermRetrieval
          Controls whether reasoning service should retrieve terms (esp.
private  java.util.Map<SSWAPDocument,com.hp.hpl.jena.rdf.model.Model> crossDocumentDependencies
          Temporarily added dependent SSWAPDocuments (e.g., if a user used a term from a different document in a query) The keys are the SSWAPDocuments, and the values are Jena Models (with TBox of that SSWAPDocument) that have been temporarily added as submodels to this ontModel.
private  boolean crossDocumentTermRetrieval
          Controls whether reasoning service should monitor attempts to use terms from a different source model, and try to temporarily retrieve information from that different model to answer the query.
static ReasoningServiceImpl.ExplanationSyntax EXPLANATION_SYNTAX
           
private static org.apache.log4j.Logger LOGGER
           
private  ModelResolver mResolver
          Used to resolve externally defined terms
private  com.hp.hpl.jena.ontology.OntModel ontModel
          The Jena OntModel created from the regular Jena model.
private  java.util.Map<java.lang.String,ReasoningServiceImpl.PropertyInformation> propertyInformation
          A cache for property information so that we do not have repeatedly query the reasoner while validating values.
private  java.util.List<SourceModel> sourceModels
          The source models for which this reasoning service operates.
private static java.util.Set<java.lang.String> TRANSLATION_NO_FOLLOW_PROPS
          A set of URIs of properties that should not be followed during translation/validation process (essentially an exclusion list) Reasons why the predicates are included: - sswap:providedBy - in a typical RDG/RIG/RRG it points to a provider individual, but that provider individual does not contain (in RDG/RIG/RRG) any of the required properties for SSWAPProvider (e.g., name).
 
Constructor Summary
ReasoningServiceImpl(SourceModel sourceModel)
          Creates a reasoning service based on Pellet reasoner.
 
Method Summary
 void addModel(SSWAPModel model)
          Adds another model (as a sub-model) whose contents are to be taken into account when reasoning.
private  void addSourceModel(SourceModel sourceModel)
           
private  void assertCrossModelTerms(SSWAPModel sswapModel)
          Ensures that we know all the terms from another document (source model) of the passed model(i.e., separate closure etc), if it happens to be passed to this reasoning service (can happen for two-parameter methods in reasoning service like isSubTypeOf, where one of the arguments (typically the second one) belongs to a different model).
private  void assertTermKnown(java.net.URI termURI)
          Ensures that we know the definition of the term (i.e., if the term is not known, we try to dereference it)
private  boolean containsPredicateInformation(SSWAPPredicate predicate, com.hp.hpl.jena.rdf.model.Property informationProperty, com.hp.hpl.jena.rdf.model.Resource expectedResource)
          Checks whether the ontModel contains a specific information about the predicate.
private  boolean containsPropertyInformation(SSWAPPredicate predicate)
          Checks whether this reasoning service has already cached information about the particular property/predicate
private  boolean containsSourceModel(SSWAPDocument sourceModel)
           
private  aterm.ATermAppl createClassExpression(org.mindswap.pellet.KnowledgeBase kb, SSWAPNode node, boolean assertIndirectValues)
          Creates a class expression from an individual based on asserted types and properties.
private  aterm.ATermAppl createClassExpression(org.mindswap.pellet.Node ind, boolean assertDirectValue, boolean assertIndirectValues, java.util.Set<org.mindswap.pellet.Edge> visitedEdges)
           
private  ReasoningServiceImpl.PropertyInformation createPropertyInformation(SSWAPPredicate predicate)
          Creates a PropertyInformation entry for the predicate.
 com.hp.hpl.jena.rdf.model.Model extractABox()
          Extracts the ABox from the current OntModel
static com.hp.hpl.jena.rdf.model.Model extractABox(com.hp.hpl.jena.rdf.model.Model model)
           
 com.hp.hpl.jena.rdf.model.Model extractInferredIndividualModel(java.net.URI individualURI)
           
 com.hp.hpl.jena.rdf.model.Model extractInferredModel()
           
 com.hp.hpl.jena.rdf.model.Model extractTBox()
          Extracts the TBox from the current OntModel
static com.hp.hpl.jena.rdf.model.Model extractTBox(com.hp.hpl.jena.rdf.model.Model model)
           
static java.util.List<com.hp.hpl.jena.rdf.model.Statement> extractTypeDefinition(com.hp.hpl.jena.rdf.model.Model m, com.hp.hpl.jena.rdf.model.Resource type)
          Extracts all the statements that make up an anonymous type.
 SSWAPType getDomain(SSWAPPredicate predicate)
           
 java.util.Collection<SSWAPType> getDomains(SSWAPPredicate predicate)
           
private  java.lang.String getEnumType(com.hp.hpl.jena.rdf.model.Resource anonDataRange)
           
 java.util.Collection<java.lang.String> getInferredNamedTypes(SSWAPIndividual individual)
          Gets all inferred named types for an individual (anonymous classes are not included).
 java.util.Collection<java.lang.String> getInferredTypes(SSWAPIndividual individual)
          Gets all inferred types for the individual.
 com.hp.hpl.jena.ontology.OntModel getOntModel()
           
 org.mindswap.pellet.KnowledgeBase getPelletKB()
           
private  java.util.Collection<java.lang.String> getPredicateInformation(SSWAPPredicate predicate, com.hp.hpl.jena.rdf.model.Property informationProperty)
           
private  ReasoningServiceImpl.PropertyInformation getPropertyInformation(SSWAPPredicate predicate)
          Gets information about the property.
 java.lang.String getRange(SSWAPPredicate predicate)
           
 java.util.Collection<java.lang.String> getRanges(SSWAPPredicate predicate)
           
private  java.lang.String getSinglePredicateInformation(SSWAPPredicate predicate, com.hp.hpl.jena.rdf.model.Property informationProperty)
          Gets information about the predicate.
 java.util.Collection<java.lang.String> getSuperClasses(java.lang.String uri)
           
 java.lang.String getTypeForEnumRange(SSWAPPredicate predicate)
           
private  void handleInconsistentOntologyException(org.mindswap.pellet.exceptions.InconsistentOntologyException e)
           
static boolean isABoxStatement(com.hp.hpl.jena.rdf.model.Statement s)
          Checks whether a triple belongs to ABox.
 boolean isAnnotationPredicate(SSWAPPredicate predicate)
           
private static boolean isAnonymousTypeAssertionTriple(com.hp.hpl.jena.rdf.model.Statement s)
          Checks whether the given triple asserts that an individual belongs to an anonymous class (i.e., x rdf:type [ ])
private static boolean isAsserted(org.mindswap.pellet.DependencySet ds)
           
 boolean isAutomaticTermRetrieval()
           
private static boolean isBlacklistedForExtraction(com.hp.hpl.jena.rdf.model.Statement s)
          Check whether the statement is not meant to be extracted.
private static boolean isBuiltInVocabulary(java.lang.String uri)
          Check whether the given URI is a built-in vocabulary (i.e., the vocabulary in owl:, rdf: or rdfs: namespaces
 boolean isCrossDocumentTermRetrieval()
           
 boolean isDatatypePredicate(SSWAPPredicate predicate)
           
 boolean isDifferentFrom(SSWAPIndividual ind1, SSWAPIndividual ind2)
           
 boolean isIntersection(java.lang.String type)
           
<T extends SSWAPNode>
boolean
isMappingValid(T protocolIndividual, ProtocolImpl.MappingValidator.MappingType type, T rdgIndividual)
           
 boolean isObjectPredicate(SSWAPPredicate predicate)
           
 boolean isSameAs(SSWAPIndividual ind1, SSWAPIndividual ind2)
           
private static boolean isSSWAPTerm(aterm.ATermAppl term)
           
 boolean isStrictSubPredicateOf(SSWAPPredicate sub, SSWAPPredicate sup)
          Checks whether one predicate is a strict sub predicate of another.
 boolean isStrictSubTypeOf(SSWAPType sub, SSWAPType sup)
           
 boolean isSubPredicateOf(SSWAPPredicate sub, SSWAPPredicate sup)
           
 boolean isSubTypeOf(SSWAPType sub, SSWAPType sup)
           
private static boolean isTBoxStatement(com.hp.hpl.jena.rdf.model.Statement s)
          Checks whether a triple belongs to a TBox
private  boolean isTermKnown(java.net.URI termURI)
          Checks whether we know anything about the given term (i.e., whether it is used anywhere in the ontModel).
private  void releaseCrossModelTerms(SSWAPModel... sswapModels)
          Releases all the terms that were temporarily imported by assertCrossModelTerms() for each model.
 void removeModel(SSWAPModel model)
          Removes a previously added submodel (via addModel(Model)).
private  void removeSourceModel(SourceModel sourceModel)
           
private  java.lang.String renderInconsistencyExplanation()
           
 void resetKB()
           
private  com.hp.hpl.jena.rdf.model.Model retrieveAdditionalTerm(java.net.URI termURI)
          Retrieves additional term (by dereferencing it).
 void setAutoDetectChanges(boolean autodetect)
           
 void setAutomaticTermRetrieval(boolean automaticTermRetrieval)
           
 void setCrossDocumentTermRetrieval(boolean crossDocumentTermRetrieval)
           
 SourceModel translate(SSWAPType type, SSWAPElement individual)
          Translates the individual into statements that are required and used by the specified class.
 void validateConsistency()
          Verifies the consistency of the underlying ontologies (together).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final org.apache.log4j.Logger LOGGER

EXPLANATION_SYNTAX

public static ReasoningServiceImpl.ExplanationSyntax EXPLANATION_SYNTAX

TRANSLATION_NO_FOLLOW_PROPS

private static final java.util.Set<java.lang.String> TRANSLATION_NO_FOLLOW_PROPS
A set of URIs of properties that should not be followed during translation/validation process (essentially an exclusion list) Reasons why the predicates are included: - sswap:providedBy - in a typical RDG/RIG/RRG it points to a provider individual, but that provider individual does not contain (in RDG/RIG/RRG) any of the required properties for SSWAPProvider (e.g., name). Moreover, closure does not dereference individuals, so we won't get that information. This would cause any translation to fail, so we are making an exception for sswap:providedBy - sswap:operatesOn - prevents translation of sswap:Resource from proceeding too far (onto sswap:Graph); the elements in the graph (e.g., sswap:Subject) are translated separately - sswap:mapsTo - prevents translation of sswap:Subject from proceeding too far (to sswap:Object); objects are currently not translated


automaticTermRetrieval

private boolean automaticTermRetrieval
Controls whether reasoning service should retrieve terms (esp. properties and named classes), it does not know about.


crossDocumentTermRetrieval

private boolean crossDocumentTermRetrieval
Controls whether reasoning service should monitor attempts to use terms from a different source model, and try to temporarily retrieve information from that different model to answer the query.


ontModel

private final com.hp.hpl.jena.ontology.OntModel ontModel
The Jena OntModel created from the regular Jena model.


sourceModels

private final java.util.List<SourceModel> sourceModels
The source models for which this reasoning service operates. This lists is guaranteed to be non-empty at all times and the first entry is always the original source model used to create this reasoning service.


crossDocumentDependencies

private java.util.Map<SSWAPDocument,com.hp.hpl.jena.rdf.model.Model> crossDocumentDependencies
Temporarily added dependent SSWAPDocuments (e.g., if a user used a term from a different document in a query) The keys are the SSWAPDocuments, and the values are Jena Models (with TBox of that SSWAPDocument) that have been temporarily added as submodels to this ontModel.


propertyInformation

private java.util.Map<java.lang.String,ReasoningServiceImpl.PropertyInformation> propertyInformation
A cache for property information so that we do not have repeatedly query the reasoner while validating values. The keys are URIs of the properties (as strings), and the values are PropertyInformation entries


mResolver

private final ModelResolver mResolver
Used to resolve externally defined terms

Constructor Detail

ReasoningServiceImpl

public ReasoningServiceImpl(SourceModel sourceModel)
Creates a reasoning service based on Pellet reasoner. It also creates a corresponding, internal ontology model (which triggers classification, and it may take some time).

Parameters:
sourceModel - the Jena model to be reasoned over
Method Detail

setAutoDetectChanges

public void setAutoDetectChanges(boolean autodetect)

containsSourceModel

private boolean containsSourceModel(SSWAPDocument sourceModel)

addSourceModel

private void addSourceModel(SourceModel sourceModel)

removeSourceModel

private void removeSourceModel(SourceModel sourceModel)

setAutomaticTermRetrieval

public void setAutomaticTermRetrieval(boolean automaticTermRetrieval)

isAutomaticTermRetrieval

public boolean isAutomaticTermRetrieval()

setCrossDocumentTermRetrieval

public void setCrossDocumentTermRetrieval(boolean crossDocumentTermRetrieval)

isCrossDocumentTermRetrieval

public boolean isCrossDocumentTermRetrieval()

validateConsistency

public void validateConsistency()
                         throws ValidationException
Verifies the consistency of the underlying ontologies (together). If the method returns without throwing an exception, the ontologies are considered consistent

Throws:
ValidationException - if the ontologies are not consistent

handleInconsistentOntologyException

private void handleInconsistentOntologyException(org.mindswap.pellet.exceptions.InconsistentOntologyException e)
                                          throws org.mindswap.pellet.exceptions.InconsistentOntologyException
Throws:
org.mindswap.pellet.exceptions.InconsistentOntologyException

renderInconsistencyExplanation

private java.lang.String renderInconsistencyExplanation()

retrieveAdditionalTerm

private com.hp.hpl.jena.rdf.model.Model retrieveAdditionalTerm(java.net.URI termURI)
Retrieves additional term (by dereferencing it). Note: this method will return an empty model, if a URI of a bnode is given (no dereferencing possible)

Parameters:
termURI - the URI of the term to be retrieved.
Returns:
new closure model for the term

isTermKnown

private boolean isTermKnown(java.net.URI termURI)
Checks whether we know anything about the given term (i.e., whether it is used anywhere in the ontModel). The assumption here is that if the term is mentioned, we know the definition of this term (based on the fact that closure should have retrieved it in such a case, or it is an individual).

Parameters:
termURI - the URI of the term that should be checked
Returns:
true if the term is used anywhere

assertTermKnown

private void assertTermKnown(java.net.URI termURI)
Ensures that we know the definition of the term (i.e., if the term is not known, we try to dereference it)

Parameters:
termURI - the URI of the term

assertCrossModelTerms

private void assertCrossModelTerms(SSWAPModel sswapModel)
Ensures that we know all the terms from another document (source model) of the passed model(i.e., separate closure etc), if it happens to be passed to this reasoning service (can happen for two-parameter methods in reasoning service like isSubTypeOf, where one of the arguments (typically the second one) belongs to a different model).

Parameters:
sswapModel - the term passed to a method where cross-document query is possible. If the document of this model is different than the document for this reasoning service, this method will add the document to crossDocumentDependencies (remember to use releaseCrossModelTerms later!)

releaseCrossModelTerms

private void releaseCrossModelTerms(SSWAPModel... sswapModels)
Releases all the terms that were temporarily imported by assertCrossModelTerms() for each model. If the given invocation of assertCrossModelTerms() did not cause any term additions (or they were already removed), the invocation of this method is harmless.

Parameters:
sswapModels - variable list (array) of SSWAPModels from which to remove TBox models

isSameAs

public boolean isSameAs(SSWAPIndividual ind1,
                        SSWAPIndividual ind2)

isDifferentFrom

public boolean isDifferentFrom(SSWAPIndividual ind1,
                               SSWAPIndividual ind2)

isStrictSubTypeOf

public boolean isStrictSubTypeOf(SSWAPType sub,
                                 SSWAPType sup)

isSubTypeOf

public boolean isSubTypeOf(SSWAPType sub,
                           SSWAPType sup)

isSubPredicateOf

public boolean isSubPredicateOf(SSWAPPredicate sub,
                                SSWAPPredicate sup)

isStrictSubPredicateOf

public boolean isStrictSubPredicateOf(SSWAPPredicate sub,
                                      SSWAPPredicate sup)
Checks whether one predicate is a strict sub predicate of another.

Parameters:
sub - the candidate for the sub predicate
sup - the candidate for the super predicate
Returns:
true if sub is a strict sub predicate of sup

isIntersection

public boolean isIntersection(java.lang.String type)

getDomain

public SSWAPType getDomain(SSWAPPredicate predicate)

getDomains

public java.util.Collection<SSWAPType> getDomains(SSWAPPredicate predicate)

getRange

public java.lang.String getRange(SSWAPPredicate predicate)

getRanges

public java.util.Collection<java.lang.String> getRanges(SSWAPPredicate predicate)

getEnumType

private java.lang.String getEnumType(com.hp.hpl.jena.rdf.model.Resource anonDataRange)

getTypeForEnumRange

public java.lang.String getTypeForEnumRange(SSWAPPredicate predicate)

isObjectPredicate

public boolean isObjectPredicate(SSWAPPredicate predicate)

isDatatypePredicate

public boolean isDatatypePredicate(SSWAPPredicate predicate)

isAnnotationPredicate

public boolean isAnnotationPredicate(SSWAPPredicate predicate)

getPropertyInformation

private ReasoningServiceImpl.PropertyInformation getPropertyInformation(SSWAPPredicate predicate)
Gets information about the property. If the property is already in the cache, the cached information is returned. In case of a cache miss, we fetch the information from the reasoner, and store it in the cache before returning it from this method

Parameters:
predicate - the predicate describing the information requested
Returns:
the property information (should not be null)

containsPropertyInformation

private boolean containsPropertyInformation(SSWAPPredicate predicate)
Checks whether this reasoning service has already cached information about the particular property/predicate

Parameters:
predicate - the predicate that should be checked
Returns:
true, if there is information about this property in the cache, false otherwise

createPropertyInformation

private ReasoningServiceImpl.PropertyInformation createPropertyInformation(SSWAPPredicate predicate)
Creates a PropertyInformation entry for the predicate. This method accesses the reasoner/OntModel to inspect available information about the property.

Parameters:
predicate - the predicate for which the entry is being created.
Returns:
the property information record

getInferredNamedTypes

public java.util.Collection<java.lang.String> getInferredNamedTypes(SSWAPIndividual individual)
Gets all inferred named types for an individual (anonymous classes are not included).

Parameters:
individual - the individual
Returns:
a collection of Strings containing the URIs of types

getInferredTypes

public java.util.Collection<java.lang.String> getInferredTypes(SSWAPIndividual individual)
Gets all inferred types for the individual.

Parameters:
individual - the individual
Returns:
a collection of String containing the URIs of types (for anonymous types, these contain the internal URIs (tag:sswap.info:bnode:...)

getSuperClasses

public java.util.Collection<java.lang.String> getSuperClasses(java.lang.String uri)

getSinglePredicateInformation

private java.lang.String getSinglePredicateInformation(SSWAPPredicate predicate,
                                                       com.hp.hpl.jena.rdf.model.Property informationProperty)
Gets information about the predicate. It searches the underlying ontModel for the first statement that has the predicate URI as its subject, and the specified informationProperty as the property. The method returns the URI of the object (if the object has a URI).

Parameters:
predicate - the SSWAPPredicate to be queried about
informationProperty - the Jena property (e.g., rdfs:domain) that describes the SSWAPPredicate
Returns:
the URI of the object in the first statement found, or null (if no statements were found, or the object was not a resource)

getPredicateInformation

private java.util.Collection<java.lang.String> getPredicateInformation(SSWAPPredicate predicate,
                                                                       com.hp.hpl.jena.rdf.model.Property informationProperty)

containsPredicateInformation

private boolean containsPredicateInformation(SSWAPPredicate predicate,
                                             com.hp.hpl.jena.rdf.model.Property informationProperty,
                                             com.hp.hpl.jena.rdf.model.Resource expectedResource)
Checks whether the ontModel contains a specific information about the predicate. For example, it can check whether the given SSWAPPredicate is an object predicate.

Parameters:
predicate - the SSWAPPredicate to be queried about
informationProperty - the Jena property (e.g., rdf:type) that describes the SSWAPPredicate
expectedResource - the expected object (e.g., owl:ObjectProperty)
Returns:
true, if the ontModel contains the information, false otherwise

addModel

public void addModel(SSWAPModel model)
Description copied from interface: ReasoningService
Adds another model (as a sub-model) whose contents are to be taken into account when reasoning.

Specified by:
addModel in interface ReasoningService
Parameters:
model - dereferenced model

removeModel

public void removeModel(SSWAPModel model)
Description copied from interface: ReasoningService
Removes a previously added submodel (via addModel(Model)). The content of the removed model will no longer be taken into account when reasoning.

Specified by:
removeModel in interface ReasoningService
Parameters:
model - dereferenced model

translate

public SourceModel translate(SSWAPType type,
                             SSWAPElement individual)
                      throws ValidationException
Translates the individual into statements that are required and used by the specified class.

Parameters:
type - the URI of the class
individual - the URI of the individual
Throws:
ValidationException - if the individual is not of the specified class

extractTBox

public com.hp.hpl.jena.rdf.model.Model extractTBox()
Extracts the TBox from the current OntModel

Returns:
the extracted TBox

extractTBox

public static com.hp.hpl.jena.rdf.model.Model extractTBox(com.hp.hpl.jena.rdf.model.Model model)

extractInferredIndividualModel

public com.hp.hpl.jena.rdf.model.Model extractInferredIndividualModel(java.net.URI individualURI)

isBuiltInVocabulary

private static boolean isBuiltInVocabulary(java.lang.String uri)
Check whether the given URI is a built-in vocabulary (i.e., the vocabulary in owl:, rdf: or rdfs: namespaces

Parameters:
uri - the URI to be checked
Returns:
true, if the URI is a built-in vocabulary

isBlacklistedForExtraction

private static boolean isBlacklistedForExtraction(com.hp.hpl.jena.rdf.model.Statement s)
Check whether the statement is not meant to be extracted. Some inferences cause problems if they are extracted and then loaded back; they usually relate to standard OWL vocabulary that is not meant to be defined/re-defined in the ontology (for example an attempt to define types for owl:topObjectProperty via rdf:type causes problems because no other property is allowed to have that set of types).

Parameters:
s -
Returns:
true if the statement should not be extracted; false otherwise

isTBoxStatement

private static boolean isTBoxStatement(com.hp.hpl.jena.rdf.model.Statement s)
Checks whether a triple belongs to a TBox

Parameters:
s - Jena statement (triple)
Returns:
true if the statement belongs to TBox

isABoxStatement

public static boolean isABoxStatement(com.hp.hpl.jena.rdf.model.Statement s)
Checks whether a triple belongs to ABox. Note: for triples that belong to both TBox and ABox, this method returns false (not ABox statement). Such cases require additional processing/detection outside of this method. Such triples encode anonymous types of individuals in the ABox. An example of construct containing such triples: :x rdf:type [ owl:intersectionOf ( :A :B ) ] The anonymous type above belongs to both TBox (it defines a class; an anonymous one), and to ABox (it is an assertion of a type of an individual). Since the anonymous type does not have a valid URI (only a Bnode Id/internal URI, which cannot be used cross-document/cross-model), it cannot be just put in TBox, and be referenced from ABox; instead, it has to be put in both TBox and ABox. Since detection of this corner-case requires knowledge of a full context how the given triple/anonymous type is being used, this method cannot make such distinction (it has access only to a single triple). Therefore, it maps all triples for the anonymous type as not belonging into ABox.

Parameters:
s - the triple to be classified as belong to ABox
Returns:
true, if the triple belongs to ABox, false otherwise

isAnonymousTypeAssertionTriple

private static boolean isAnonymousTypeAssertionTriple(com.hp.hpl.jena.rdf.model.Statement s)
Checks whether the given triple asserts that an individual belongs to an anonymous class (i.e., x rdf:type [ ])

Parameters:
s - statement to be checked
Returns:
true if the given statement is a triple that asserts that an individual belongs to an anonymous class

extractTypeDefinition

public static java.util.List<com.hp.hpl.jena.rdf.model.Statement> extractTypeDefinition(com.hp.hpl.jena.rdf.model.Model m,
                                                                                        com.hp.hpl.jena.rdf.model.Resource type)
Extracts all the statements that make up an anonymous type. This method supports anonymous types that use the following OWL constructs: owl:intersectionOf, owl:unionOf, owl:complementOf, and owl:Restrictions (including properties like owl:onProperty, owl:cardinality, owl:minCardinality, owl:maxCardinality, owl:allValuesFrom, owl:someValuesFrom, owl:hasValue, owl:oneOf). This method is used to extract anonymous classes to be put in ABox (see discussion for isABoxStatement())

Parameters:
m - the model containing the statements
type - the resource that represents the anonymous type
Returns:
the list of statements that make up the anonymous type

extractABox

public com.hp.hpl.jena.rdf.model.Model extractABox()
Extracts the ABox from the current OntModel

Returns:
the extracted ABox

extractABox

public static com.hp.hpl.jena.rdf.model.Model extractABox(com.hp.hpl.jena.rdf.model.Model model)

extractInferredModel

public com.hp.hpl.jena.rdf.model.Model extractInferredModel()

resetKB

public void resetKB()

getPelletKB

public org.mindswap.pellet.KnowledgeBase getPelletKB()

getOntModel

public com.hp.hpl.jena.ontology.OntModel getOntModel()

isMappingValid

public <T extends SSWAPNode> boolean isMappingValid(T protocolIndividual,
                                                    ProtocolImpl.MappingValidator.MappingType type,
                                                    T rdgIndividual)

createClassExpression

private aterm.ATermAppl createClassExpression(org.mindswap.pellet.KnowledgeBase kb,
                                              SSWAPNode node,
                                              boolean assertIndirectValues)
Creates a class expression from an individual based on asserted types and properties. Asserted properties are interpreted as existential restrictions. SSWAP terms (both types and properties from SSWAP namespace) are ignored.


createClassExpression

private aterm.ATermAppl createClassExpression(org.mindswap.pellet.Node ind,
                                              boolean assertDirectValue,
                                              boolean assertIndirectValues,
                                              java.util.Set<org.mindswap.pellet.Edge> visitedEdges)

isAsserted

private static boolean isAsserted(org.mindswap.pellet.DependencySet ds)

isSSWAPTerm

private static boolean isSSWAPTerm(aterm.ATermAppl term)


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.