Class AxiomDescriptor
java.lang.Object
cz.cvut.kbss.ontodriver.descriptor.AbstractAxiomDescriptor
cz.cvut.kbss.ontodriver.descriptor.AxiomDescriptor
This descriptor specifies subject and properties of axioms to search for in the ontology.
Additionally, it can specify context URIs for both the descriptor and individual properties so that the underlying driver knows where to look for the corresponding axioms.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAssertion(Assertion assertion) Adds the specified assertion to this descriptor.addAssertionContext(Assertion assertion, URI context) Sets context for the specified assertion.addSubjectContext(URI context) Adds subject context.booleancontainsAssertion(Assertion assertion) Checks whether this descriptor contains the specified assertion.booleangetAssertionContexts(Assertion assertion) Gets the set of repository context identifiers in which the specified assertion values may be.Gets unmodifiable view of the properties in this descriptor.Gets the set of repository context identifiers in which this descriptor's subject may be.inthashCode()toString()Methods inherited from class cz.cvut.kbss.ontodriver.descriptor.AbstractAxiomDescriptor
getSubject
-
Constructor Details
-
AxiomDescriptor
-
-
Method Details
-
addSubjectContext
Adds subject context.The context can be
null, indicating the default context.- Parameters:
context- The context to use for subject- Returns:
- This instance
-
addAssertion
Adds the specified assertion to this descriptor.- Parameters:
assertion- The assertion to add- Throws:
NullPointerException- Whenassertionisnull
-
addAssertionContext
Sets context for the specified assertion.Note that the assertion has to be already present in this descriptor.
- Parameters:
assertion- The property to set context forcontext- Context URI. Usenullto indicate the default context- Returns:
- This instance
- Throws:
IllegalArgumentException- If there is no such assertion in this descriptorNullPointerException- Whenassertionisnull
-
getAssertions
Gets unmodifiable view of the properties in this descriptor.- Specified by:
getAssertionsin classAbstractAxiomDescriptor- Returns:
- Set of assertions in this descriptor
-
containsAssertion
Checks whether this descriptor contains the specified assertion.- Specified by:
containsAssertionin classAbstractAxiomDescriptor- Parameters:
assertion- The assertion to check- Returns:
- True if the assertion is already present in this descriptor, false otherwise
-
getSubjectContexts
Description copied from class:AbstractAxiomDescriptorGets the set of repository context identifiers in which this descriptor's subject may be.The contract of this method is as follows: it must not return
null, if the the subject is in the default context, an empty set is returned.- Specified by:
getSubjectContextsin classAbstractAxiomDescriptor- Returns:
- Set of context identifiers
-
getAssertionContexts
Description copied from class:AbstractAxiomDescriptorGets the set of repository context identifiers in which the specified assertion values may be.If no context was explicitly set, the same contexts as the subject's are returned. An empty result indicates that the default context should be used.
- Specified by:
getAssertionContextsin classAbstractAxiomDescriptor- Returns:
- Set of context identifiers
-
equals
- Overrides:
equalsin classAbstractAxiomDescriptor
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractAxiomDescriptor
-
toString
-