Class Terms

java.lang.Object
ai.chatur.cortex.core.Terms

public final class Terms extends Object
Creates Terms from Jena nodes, resolving prefixes against a prefix mapping.
  • Method Summary

    Modifier and Type
    Method
    Description
    static ai.chatur.cortex.Term
    of(org.apache.jena.rdf.model.RDFNode node, org.apache.jena.shared.PrefixMapping prefixes)
    Returns the term for the given node: the longest matching namespace of the prefix mapping is abbreviated, literals carry their lexical form, and URIs no prefix matches carry the full URI.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • of

      public static ai.chatur.cortex.Term of(org.apache.jena.rdf.model.RDFNode node, org.apache.jena.shared.PrefixMapping prefixes)
      Returns the term for the given node: the longest matching namespace of the prefix mapping is abbreviated, literals carry their lexical form, and URIs no prefix matches carry the full URI.

      The longest match wins so the term does not depend on the iteration order of the prefix mapping — unlike Jena's own shortForm, which returns the first matching namespace of a HashMap and so can answer differently from run to run for a URI matched by more than one declared prefix.

      Parameters:
      node - the node to describe
      prefixes - the prefix mapping to abbreviate the URI against
      Returns:
      the term for the node