Class TemplateMatcher

java.lang.Object
com.atomgraph.processor.util.TemplateMatcher

public class TemplateMatcher extends Object
JAX-RS provider for resource template class in the sitemap ontology that matches the current request.
Author:
Martynas Jusevičius <martynas@atomgraph.com>
  • Constructor Details

    • TemplateMatcher

      public TemplateMatcher(org.apache.jena.ontology.Ontology ontology)
  • Method Details

    • match

      public Template match(URI uri, URI base)
      Given an absolute URI and a base URI, returns ontology class with a matching URI template, if any.
      Parameters:
      uri - absolute URI being matched
      base - base URI
      Returns:
      matching ontology class or null, if none
    • match

      public List<TemplateMatcher.TemplatePrecedence> match(org.apache.jena.ontology.Ontology ontology, CharSequence path, int level)
      Matches path (relative URI) against URI templates in sitemap ontology. This method uses Jersey implementation of the JAX-RS URI matching algorithm.
      Parameters:
      ontology - sitemap ontology
      path - URI path
      level -
      Returns:
      URI template/class mapping
    • match

      public Template match(CharSequence path)
    • match

      public Template match(org.apache.jena.ontology.Ontology ontology, CharSequence path)
      Given a relative URI and URI template property, returns ontology class with a matching URI template, if any. URIs are matched against the URI templates specified in resource templates (sitemap ontology classes). Templates in the base ontology model have priority (are matched first) against templates in imported ontologies.
      Parameters:
      ontology - sitemap ontology model
      path - absolute path (relative URI)
      Returns:
      matching ontology class or null, if none
      See Also:
    • getOntology

      public org.apache.jena.ontology.Ontology getOntology()