Package com.atomgraph.processor.util
Class TemplateMatcher
java.lang.Object
com.atomgraph.processor.util.TemplateMatcher
JAX-RS provider for resource template class in the sitemap ontology that matches the current request.
- Author:
- Martynas Jusevičius <martynas@atomgraph.com>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.jena.ontology.Ontologymatch(CharSequence path) Given an absolute URI and a base URI, returns ontology class with a matching URI template, if any.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.match(org.apache.jena.ontology.Ontology ontology, CharSequence path, int level) Matches path (relative URI) against URI templates in sitemap ontology.
-
Constructor Details
-
TemplateMatcher
public TemplateMatcher(org.apache.jena.ontology.Ontology ontology)
-
-
Method Details
-
match
Given an absolute URI and a base URI, returns ontology class with a matching URI template, if any.- Parameters:
uri- absolute URI being matchedbase- 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 ontologypath- URI pathlevel-- Returns:
- URI template/class mapping
-
match
-
match
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 modelpath- absolute path (relative URI)- Returns:
- matching ontology class or null, if none
- See Also:
-
getOntology
public org.apache.jena.ontology.Ontology getOntology()
-