Class CustomGraphQueryInferencer

    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • watchPredicates

        private final java.util.Collection<Value> watchPredicates
      • watchSubjects

        private final java.util.Collection<Value> watchSubjects
      • watchObjects

        private final java.util.Collection<Value> watchObjects
      • hasWatchValues

        private boolean hasWatchValues
    • Constructor Detail

      • CustomGraphQueryInferencer

        public CustomGraphQueryInferencer()
      • CustomGraphQueryInferencer

        public CustomGraphQueryInferencer​(QueryLanguage language,
                                          java.lang.String queryText,
                                          java.lang.String matcherText)
                                   throws MalformedQueryException,
                                          UnsupportedQueryLanguageException,
                                          SailException
        Create a new custom inferencer.
        Parameters:
        language - language that queryText and matcherText are expressed in
        queryText - a query that returns an RDF graph of inferred statements to be added to the underlying Sail
        matcherText - a query that returns an RDF graph of existing inferred statements already added previously
        Throws:
        MalformedQueryException - if there is a problem parsing either of the given queries
        UnsupportedQueryLanguageException - if an unsupported query language is specified
        SailException - if a problem occurs interpreting the rule pattern
      • CustomGraphQueryInferencer

        public CustomGraphQueryInferencer​(NotifyingSail baseSail,
                                          QueryLanguage language,
                                          java.lang.String queryText,
                                          java.lang.String matcherText)
                                   throws MalformedQueryException,
                                          UnsupportedQueryLanguageException,
                                          SailException
        Create a new custom inferencer.
        Parameters:
        baseSail - an underlying Sail, such as another inferencer or a SailRepository
        language - language that queryText and matcherText are expressed in
        queryText - a query that returns an RDF graph of inferred statements to be added to the underlying Sail
        matcherText - a query that returns an RDF graph of existing inferred statements already added previously
        Throws:
        MalformedQueryException - if there is a problem parsing either of the given queries
        UnsupportedQueryLanguageException
        SailException - if a problem occurs interpreting the rule pattern
    • Method Detail

      • setFields

        public final void setFields​(QueryLanguage language,
                                    java.lang.String queryText,
                                    java.lang.String matcherText)
                             throws MalformedQueryException,
                                    SailException
        Called in order to set all the fields needed for the inferencer to function.
        Parameters:
        language - language that queryText and matcherText are expressed in
        queryText - a query that returns an RDF graph of inferred statements to be added to the underlying Sail
        matcherText - a query that returns an RDF graph of existing inferred statements already added previously
        Throws:
        MalformedQueryException - if there is a problem parsing either of the given queries
        SailException - if a problem occurs interpreting the rule pattern
      • init

        public void init()
                  throws SailException
        Description copied from interface: Sail
        Initializes the Sail. Care should be taken that required initialization parameters have been set before this method is called. Please consult the specific Sail implementation for information about the relevant parameters.
        Specified by:
        init in interface Sail
        Overrides:
        init in class SailWrapper
        Throws:
        SailException - If the Sail could not be initialized.
      • getWatchSubjects

        public java.util.Collection<Value> getWatchSubjects()
        Exposed for test purposes.
        Returns:
        a computed collection of the statement subjects that, when added or removed, trigger an update of inferred statements
      • getWatchPredicates

        public java.util.Collection<Value> getWatchPredicates()
        Exposed for test purposes.
        Returns:
        a computed collection of the statement predicates that, when added or removed, trigger an update of inferred statements
      • getWatchObjects

        public java.util.Collection<Value> getWatchObjects()
        Exposed for test purposes.
        Returns:
        a computed collection of the statement objects that, when added or removed, trigger an update of inferred statements