A set of Term templates for the rdfInterface

0.5.0 2021-05-26 18:15 UTC

This package is auto-updated.

Last update: 2021-12-27 20:36:23 UTC


Latest Stable Version Build status Coverage Status License


  • A set of term templates allowing to match desired RDF named nodes, literals and quads. To be used mainly as rdfInterface\Dataset methods $filter parameter.
  • A convenient methods for extracting single terms and/or their values from rdfInterface\Dataset.

Usage examples can be found here (search for rdfInterface usage examples).

Term-matching classes

(all classes in the termTemplate namespace)

Match by Supported operators Match both named nodes and literals Match only named nodes Match only literals Remarks
term's string value ==, <, >, <=, >=, starts with, ends with, contains, any value ValueTemplate NamedNodeTemplate LiteralTemplate [1]
term's numeric value ==, <, >, <=, >=, isnumeric NA NA NumericTemplate [2]
regex on term's string value regex match RegexTemplate NamedNodeRegexTemplate LiteralRegexTemplate

[1] Supports filtering also by literal's lang (using == and any operators) and datatype (only using == operator).

[2] Supports both strict and non-strict mode. In the strict mode comparison with literals with non-numeric datatype returns false no matter their value.

Other classes

  • termTemplate\AnyOfTemplate - matches terms being equal to any of given array of rdfInterface\TermCompare objects.
  • termTemplate\DatasetExtractors - provides a set of static methods for extracting rdfInterface\Dataset quad elements as single rdfInterface\Term, single value, array of rdfInterface\Term or array of values.


  • Obtain the Composer
  • Run composer require sweetrdf/term-templates

Automatically generated documentation


It's very incomplete but better than nothing.
RdfInterface documentation is included which explains the most important design decisions.