Module: RDF::Microdata::Expansion
- Included in:
- Reader
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/rdf-microdata-73e8bfd8e661/lib/rdf/microdata/expansion.rb
Overview
The Expansion module performs a subset of OWL entailment rules on the base class, which implementes RDF::Readable.
Defined Under Namespace
Classes: Rule
Instance Method Summary collapse
-
#expand ⇒ RDF::Graph
Perform vocabulary expansion on the resulting default graph.
- #rule(name, &block) ⇒ Object
Instance Method Details
#expand ⇒ RDF::Graph
Perform vocabulary expansion on the resulting default graph.
Vocabulary expansion relies on a sub-set of OWL OWL2-PROFILES entailment to add triples to the default graph based on rules and property/class relationships described in referenced vocabularies.
For all objects that are the target of an rdfa:usesVocabulary property, load the IRI into a repository.
Subsequently, perform OWL expansion using rules prp-spo1, prp-eqp1, and prp-eqp2 placing resulting triples into the default graph. Iterate on this step until no more triples are added.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/rdf-microdata-73e8bfd8e661/lib/rdf/microdata/expansion.rb', line 25 def repo = RDF::Repository.new repo << self # Add default graph log_debug("expand") {"Loaded #{repo.size} triples into default graph"} repo = owl_entailment(repo) # Return graph with default graph graph = RDF::Graph.new repo.statements.each {|st| graph << st} graph end |