Class AxiomDescriptor

java.lang.Object
cz.cvut.kbss.ontodriver.descriptor.AbstractAxiomDescriptor
cz.cvut.kbss.ontodriver.descriptor.AxiomDescriptor

public class AxiomDescriptor extends AbstractAxiomDescriptor
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 Details

    • AxiomDescriptor

      public AxiomDescriptor(NamedResource subject)
  • Method Details

    • addSubjectContext

      public AxiomDescriptor addSubjectContext(URI context)
      Adds subject context.

      The context can be null, indicating the default context.

      Parameters:
      context - The context to use for subject
      Returns:
      This instance
    • addAssertion

      public void addAssertion(Assertion assertion)
      Adds the specified assertion to this descriptor.
      Parameters:
      assertion - The assertion to add
      Throws:
      NullPointerException - When assertion is null
    • addAssertionContext

      public AxiomDescriptor addAssertionContext(Assertion assertion, URI context)
      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 for
      context - Context URI. Use null to indicate the default context
      Returns:
      This instance
      Throws:
      IllegalArgumentException - If there is no such assertion in this descriptor
      NullPointerException - When assertion is null
    • getAssertions

      public Set<Assertion> getAssertions()
      Gets unmodifiable view of the properties in this descriptor.
      Specified by:
      getAssertions in class AbstractAxiomDescriptor
      Returns:
      Set of assertions in this descriptor
    • containsAssertion

      public boolean containsAssertion(Assertion assertion)
      Checks whether this descriptor contains the specified assertion.
      Specified by:
      containsAssertion in class AbstractAxiomDescriptor
      Parameters:
      assertion - The assertion to check
      Returns:
      True if the assertion is already present in this descriptor, false otherwise
    • getSubjectContexts

      public Set<URI> getSubjectContexts()
      Description copied from class: AbstractAxiomDescriptor
      Gets 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:
      getSubjectContexts in class AbstractAxiomDescriptor
      Returns:
      Set of context identifiers
    • getAssertionContexts

      public Set<URI> getAssertionContexts(Assertion assertion)
      Description copied from class: AbstractAxiomDescriptor
      Gets 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:
      getAssertionContexts in class AbstractAxiomDescriptor
      Returns:
      Set of context identifiers
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractAxiomDescriptor
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class AbstractAxiomDescriptor
    • toString

      public String toString()
      Overrides:
      toString in class Object