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 Summary
FieldsModifier and TypeFieldDescriptionprotected final URIprotected org.apache.jena.rdf.model.Modelprotected final RewriterConfigprotected final Resource<?> protected Rewriter<DOMResource, XPathRefinedByRFC5147CharScheme, ? extends Point> protected final RewriterFactorystatic final String -
Constructor Summary
ConstructorsConstructorDescriptionNormalizeXPathSelectorRefinedByRFC5147CharScheme(Resource<?> resource, URI iri, RewriterFactory rewriterFactory, org.apache.jena.rdf.model.Model model, RewriterConfig normalizerConfig) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(org.apache.jena.rdf.model.Resource selector) This is the method of the function interfaceConsumerand actually does the normalization without throwing errors.voidacceptThrows(org.apache.jena.rdf.model.Resource selector) Do the normalization and throw exceptions on errors.protected static booleanfilter(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.
-
Field Details
-
RFC5147
- See Also:
-
resource
-
iri
-
model
protected org.apache.jena.rdf.model.Model model -
rewriterFactory
-
rewriter
-
normalizerConfig
-
error
-
-
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 interfaceConsumerand actually does the normalization without throwing errors. -
acceptThrows
public void acceptThrows(org.apache.jena.rdf.model.Resource selector) throws ModelException, NumberFormatException, SelectorException Do the normalization and throw exceptions on errors. -
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 RDFModelselector- - A selectorResource- Returns:
- a filtered subset of
selectors
-