A slightly opinionated, common set of 'rules' for creating rdf data using 'rdf-engine':
- Data Rules: for loading tables (csv), hierarchical (json), and rdf (ttl).
- Mapping rule: SPARQL construct
- Ontology rules: Inference and validation using TopQuadrant
These rules come together in the 'engine'.
Develop with uv sync --all-packages --all-extras.
Run python tasks.py stamp_ver before pypi publishing.
These are choices given the common use case of mapping data to an ontology. They are somewhat firm.
- RDF1.2 annotates tripes with metadata as
<<?s ?p ?o>> ?mp ?mowhere?mpand?mocorrespond to simple (key,value) pairs of metadata. - Mappings are in the form of SPARQL constructs
stored as files with a
.mapping.rqextension (can also be.mapping.sparql). - Each (specified) ontology will be processed separately.
Examine how rules are fed into an engine in the tests. The common workflow is:
-
Specify rules. Each rule is constructed by providing arguments to
mkrule.mkruleprocesses objects such as file paths and data objects. A distinction is made for 'data rules'; These are only triggered once in the beginning. -
Specify engine run parameters. See
runfunction documentation. -
Extract data subsets with queries. 'System' queries are
mapped_and_inferredandvalidation(results). It's best to extract these using thequeryfunction as they slightly depend on configuration.