Class NormalizeXPathSelectorRefinedByRFC5147CharScheme

java.lang.Object
de.wwu.scdh.annotation.selection.wadm.NormalizeXPathSelectorRefinedByRFC5147CharScheme
All Implemented Interfaces:
Consumer<org.apache.jena.rdf.model.Resource>

public class NormalizeXPathSelectorRefinedByRFC5147CharScheme extends Object implements Consumer<org.apache.jena.rdf.model.Resource>
This class can be used to normalize the model of all WADM XPathSelectors, that are refined by RFC5147 conforming FragmentSelectors. An Rewriter does the task of normalization.

This class implements the Consumer interface and can thus be used in a functional style like forEach(new NormalizeAnnoation(...)) on some resource iterator. The normalization will by side effect be written to the Model which was passed into the constructor.

  • Field Details

  • Constructor Details

    • NormalizeXPathSelectorRefinedByRFC5147CharScheme

      public NormalizeXPathSelectorRefinedByRFC5147CharScheme(Resource<?> resource, URI iri, RewriterFactory rewriterFactory, org.apache.jena.rdf.model.Model model, RewriterConfig normalizerConfig)
  • Method Details

    • accept

      public void accept(org.apache.jena.rdf.model.Resource selector)
      This is the method of the function interface Consumer and actually does the normalization without throwing errors.
      Specified by:
      accept in interface Consumer<org.apache.jena.rdf.model.Resource>
    • acceptThrows

      public void acceptThrows(org.apache.jena.rdf.model.Resource selector) throws ModelException, NumberFormatException, SelectorException
      Do the normalization and throw exceptions on errors.
      Throws:
      ModelException
      NumberFormatException
      SelectorException
    • filter

      protected static boolean filter(org.apache.jena.rdf.model.Model model, org.apache.jena.rdf.model.Resource selector)
      Use this to filter out XPath selectors that are refined by Fragment selectors conforming to RFC5147.
      Parameters:
      model - - The RDF Model
      selector - - A selector Resource
      Returns:
      a filtered subset of selectors