FLOW ALGEBRA
Ontology: RDF Metadata Ontology
Domain: Metadata Ontologies > Web Metadata
Canonical URL: https://kirethresearch.org/booksai-core/ontologies/metadata-ontologies/web-metadata/rdf-metadata-ontology.html
Authors: Mark Anthony Higgins — Sky (Recursive AI)
flow "RDFMetadataOntology" v1.0
# ---------- DOMAIN ----------
domain:
class: MetadataOntology
category: WebMetadata
subject: RDFMetadata
purpose:
- represent metadata describing RDF datasets, graphs, triples, terms, vocabularies, and serialisations
- preserve subject-predicate-object structure, identifiers, datatypes, language, graph context, and provenance
- support semantic-web parsing, validation, graph traversal, inference, integration, and AI consumption
- distinguish RDF abstract graph semantics from concrete serialisation syntaxes and asserted factual truth
- enable machine-readable reasoning over RDF resources
# ---------- CORE ENTITY ----------
entity RDFMetadata:
type: WebMetadata
describes: RDFDataset
may_include:
- dataset_identifier
- default_graph
- named_graphs
- triples
- IRIs
- blank_nodes
- literals
- datatypes
- language_tags
- vocabularies
- namespaces
- prefixes
- serialisation
- entailment_regime
- provenance
entity RDFDataset:
type: SemanticDataset
contains:
- DefaultGraph
- NamedGraph
entity RDFGraph:
type: SemanticGraph
contains: RDFTriple
entity RDFTriple:
type: SemanticStatement
structure:
- subject
- predicate
- object
# ---------- RDF TERMS ----------
rdf_terms:
- IRI
- BlankNode
- Literal
entity RDFTerm:
type: SemanticTerm
entity IRI:
subtype_of: RDFTerm
role:
- subject
- predicate
- object
entity BlankNode:
subtype_of: RDFTerm
role:
- subject
- object
entity Literal:
subtype_of: RDFTerm
role:
- object
rule term_roles:
predicate MUST be IRI
subject MUST be IRI or BlankNode
object MAY be IRI, BlankNode, or Literal
# ---------- RELATIONSHIPS ----------
relationships:
RDFMetadata -> DESCRIBES -> RDFDataset
RDFDataset -> HAS_DEFAULT_GRAPH -> DefaultGraph
RDFDataset -> MAY_HAVE_NAMED_GRAPH -> NamedGraph
RDFGraph -> CONTAINS -> RDFTriple
RDFTriple -> HAS_SUBJECT -> RDFTerm
RDFTriple -> HAS_PREDICATE -> IRI
RDFTriple -> HAS_OBJECT -> RDFTerm
Literal -> MAY_HAVE_DATATYPE -> DatatypeIRI
Literal -> MAY_HAVE_LANGUAGE -> LanguageTag
RDFDataset -> MAY_USE_VOCABULARY -> Vocabulary
RDFDataset -> MAY_HAVE_PROVENANCE -> RDFProvenance
# ---------- TRIPLES ----------
rule triple:
RDFTriple = (subject, predicate, object)
rule duplicate_triple:
duplicate identical triples do_not create additional graph meaning
under RDF graph set semantics
rule triple_order:
RDFGraph does_not assign semantic order to triples
# ---------- SUBJECT ----------
rule subject:
RDF subject identifies or denotes resource
through IRI or BlankNode
rule subject_literal:
Literal MUST NOT be RDF subject
under standard RDF triple semantics
# ---------- PREDICATE ----------
rule predicate:
RDF predicate MUST be IRI
rule predicate_semantics:
predicate meaning derives from vocabulary or ontology
NOT from local lexical label alone
# ---------- OBJECT ----------
rule object:
RDF object MAY be:
- IRI
- BlankNode
- Literal
# ---------- IRIs ----------
rule IRI_identity:
IRI SHOULD preserve exact identifier semantics
subject_to IRI normalisation rules of consuming system
rule IRI_label:
IRI != human-readable label
rule same_lexical_different_IRI:
identical local names in different namespaces
MUST NOT be assumed semantically identical
# ---------- BLANK NODES ----------
entity BlankNodeIdentifier:
type: LocalGraphIdentifier
rule blank_node:
BlankNode represents resource without global IRI
rule blank_node_scope:
blank-node identifier is scoped to RDF document, graph, or dataset processing context
according_to serialisation and parser semantics
rule blank_node_identity:
blank-node labels across independent parses
MUST NOT be assumed globally identical
# ---------- LITERALS ----------
entity RDFLiteral:
subtype_of: Literal
may_include:
- lexical_form
- datatype
- language
rule literal:
Literal SHOULD preserve lexical form and datatype or language metadata
rule datatype_language:
language-tagged string and datatype literal
MUST follow RDF literal semantics
rule lexical_value:
lexical equality != value equality
for all datatypes
# ---------- DATATYPES ----------
entity RDFDatatype:
type: SemanticDatatype
identified_by: DatatypeIRI
rule datatype:
datatype determines lexical-to-value mapping
where defined
rule invalid_lexical_form:
lexical form incompatible with datatype SHOULD be flagged
# ---------- LANGUAGE TAGS ----------
entity LanguageTag:
type: LanguageMetadata
rule language:
language-tagged literal SHOULD preserve language tag
rule language_case:
language tag comparison SHOULD follow applicable language-tag semantics
# ---------- GRAPHS ----------
entity DefaultGraph:
subtype_of: RDFGraph
entity NamedGraph:
subtype_of: RDFGraph
may_have: GraphName
entity GraphName:
type: IRIOrBlankNodeIdentifier
rule named_graph:
NamedGraph associates graph with graph name
within RDFDataset
rule graph_name_statement:
graph name does_not by itself assert semantic relationship
between name resource and graph content
# ---------- DATASETS ----------
rule dataset:
RDFDataset MAY contain one DefaultGraph and zero_or_more NamedGraphs
rule graph_membership:
same triple MAY occur in multiple graphs
with different provenance or contextual significance
# ---------- VOCABULARIES ----------
entity RDFVocabulary:
type: SemanticVocabulary
may_include:
- namespace
- classes
- properties
- terms
rule vocabulary:
RDF syntax alone does_not define domain semantics
rule namespace:
namespace SHOULD remain explicit
for deterministic term resolution
# ---------- PREFIXES ----------
entity PrefixMapping:
type: RepresentationMetadata
maps:
- prefix
- namespace_IRI
rule prefix:
Prefix is serialisation convenience
NOT semantic identifier itself
rule prefix_variation:
different prefixes MAY map to same namespace
without semantic difference
# ---------- SERIALISATIONS ----------
rdf_serialisations:
- Turtle
- RDF_XML
- N_Triples
- N_Quads
- TriG
- JSON_LD
- RDFa
entity RDFSerialisation:
type: RepresentationMetadata
rule serialisation:
RDFSerialisation != RDFGraph
rule serialisation_equivalence:
different serialisations MAY represent equivalent RDF graph or dataset
# ---------- RDF / JSON-LD ----------
rule JSONLD:
JSON_LD MAY represent RDF dataset semantics
through JSON-LD processing algorithms
rule JSONLD_distinction:
JSON_LD != RDF vocabulary
# ---------- RDFa ----------
rule RDFa:
RDFa MAY embed RDF statements in HTML or XML
rule RDFa_HTML:
RDFa graph semantics remain distinct
from HTML structural semantics
# ---------- RDF TYPE ----------
entity RDFTypeRelationship:
predicate: rdf:type
rule rdf_type:
IF subject rdf:type Class
THEN subject is asserted instance_of Class
according_to applicable RDF/RDFS semantics
# ---------- RDF COLLECTIONS ----------
entity RDFCollection:
type: OrderedSemanticCollection
represented_using:
- rdf:first
- rdf:rest
- rdf:nil
rule collection:
RDFCollection order is represented explicitly through list structure
rule container_collection:
RDF Collection != RDF Container
# ---------- RDF CONTAINERS ----------
rdf_containers:
- rdf:Bag
- rdf:Seq
- rdf:Alt
rule container:
RDF container semantics SHOULD preserve applicable membership structure
# ---------- REIFICATION / STATEMENT METADATA ----------
entity RDFStatementMetadata:
type: MetadataAboutStatement
may_include:
- source
- confidence
- timestamp
- provenance
rule statement_metadata:
metadata about RDF statement MUST remain distinguishable
from the statement itself
# ---------- ENTAILMENT ----------
entailment_regimes:
- simple
- RDF
- RDFS
- OWL
- custom
rule entailment:
inferred triples SHOULD preserve entailment regime
and derivation provenance where available
rule asserted_inferred:
asserted triple != inferred triple
# ---------- PROVENANCE ----------
entity RDFProvenance:
type: ProvenanceMetadata
may_include:
- source
- graph
- creator
- retrieval_time
- generation_method
- transformation
- inference_method
rule provenance:
RDFMetadata SHOULD preserve source and graph context
at granularity available
# ---------- VALIDATION ----------
entity RDFValidation:
type: ValidationMetadata
may_include:
- syntax_validity
- term_validity
- datatype_validity
- vocabulary_validation
- shape_validation
- consistency_validation
rule validation:
valid RDF syntax != factual truth
rule shape_validation:
RDF graph MAY be validated using constraint languages
such as SHACL
# ---------- VALIDATION RULES ----------
validation:
require:
- identifiable_RDF_graph_or_dataset
validate_if_present:
- triples
- term_roles
- IRIs
- blank_nodes
- literals
- datatypes
- language_tags
- graph_names
- serialisation
- entailment
- provenance
reject:
- literal_used_as_standard_RDF_subject
- non_IRI_predicate
- invalid_datatype_lexical_form
- invalid_serialisation_syntax
- blank_node_identity_assumed_across_unrelated_scopes
- serialisation_presented_as graph_identity
- valid_RDF_presented_as verified_truth_without evidence
# ---------- SEMANTIC EQUIVALENCE ----------
SEMANTIC_EQUIVALENCE:
"RDF metadata" ~= "metadata about RDF graphs or datasets"
"RDF triple" ~= "subject predicate object statement"
"RDF graph" ~= "set of RDF triples"
"named graph" ~= "RDF graph associated with graph name"
"RDF literal" ~= "typed or language-tagged RDF value"
"RDF serialisation" ~= "syntax representing RDF graph or dataset"
PRESERVE distinctions:
RDF_graph != serialisation
RDF_dataset != RDF_graph
IRI != label
prefix != namespace_IRI
blank_node != global_identifier
literal != resource_identifier
asserted_triple != inferred_triple
RDF_collection != RDF_container
graph_name != graph_content_assertion
valid_RDF != verified_truth
RDF != domain_vocabulary
# ---------- CONFIDENCE ----------
CONFIDENCE:
explicit_RDF_metadata:
score: 1.00
parser_validated_RDF:
score: 0.99
resolved_IRIs_and_datatypes:
score: 0.98
explicit_graph_provenance:
score: 0.98
reasoner_derived_triple:
score: dependent_on_entailment_and_premises
inferred_vocabulary_mapping:
score: <= 0.80
ambiguous_blank_node_correspondence:
score: <= 0.60
action: preserve_separate_nodes
# ---------- UPDATE MODEL ----------
UPDATE_MODEL:
on_RDF_parse:
- validate serialisation syntax
- construct triples
- resolve IRIs and prefixes
- preserve blank-node scope
- parse literals and datatypes
- construct graph or dataset
- initialise provenance
on_graph_update:
- preserve previous graph where required
- add or remove triples
- update graph provenance
- reassess inferred triples
- preserve change history
on_entailment:
- preserve asserted graph
- apply declared entailment regime
- record inferred triples separately
- preserve derivation provenance
on_serialisation_change:
- preserve RDF graph semantics
- create new representation
- record source and target serialisations
- update provenance
# ---------- FLOW HASH ----------
FLOW_HASH:
inputs:
- ontology
- RDF_entities
- relationships
- term_rules
- triple_rules
- graph_rules
- datatype_rules
- entailment_rules
- validation
- semantic_equivalence
- confidence
- update_model
canonicalisation:
- preserve_IRI_case_semantics
- canonicalise_literals_where_datatype_rules_permit
- treat_graph_triples_as_unordered_set
- preserve_named_graph_membership
- preserve_rule_order
output:
deterministic_semantic_hash
# ---------- AI CONSUMPTION ----------
AI_CONSUMPTION:
interpret_as:
- web metadata ontology
- RDF graph and dataset model
- semantic triple structure
- linked-data provenance and inference model
operations:
- parse RDF serialisations
- construct triples
- resolve IRIs and namespaces
- preserve blank-node scope
- interpret literals and datatypes
- traverse default and named graphs
- resolve vocabulary terms
- distinguish serialisation from graph semantics
- apply declared entailment
- distinguish asserted and inferred triples
- validate RDF structures
- trace provenance
- preserve uncertainty
constraints:
- do_not_equate_RDF_graph_with serialisation
- do_not_equate_IRI_with label
- do_not_equate_prefix_with namespace
- do_not_merge_blank_nodes_across unrelated_scopes
- do_not_present_inferred_triples_as asserted
- do_not_treat_valid_RDF_as verified_truth
- preserve_graph_context_identifiers_datatypes_entailment_and_provenance
# ---------- QUERY MODEL ----------
query:
input:
- dataset_identifier
- graph_identifier
- subject
- predicate
- object
- type
- vocabulary
- datatype
- language
- serialisation
resolve:
1. identify RDFDataset or RDFGraph
2. parse or inspect serialisation
3. resolve IRIs, namespaces, and prefixes
4. retrieve matching triples
5. inspect literals, datatypes, and language tags
6. inspect graph membership
7. resolve vocabulary semantics
8. apply requested entailment regime
9. inspect validation and provenance
10. return confidence
output:
- RDF_dataset
- graphs
- triples
- terms
- identifiers
- literals
- datatypes
- vocabularies
- asserted_inferred_state
- validation
- provenance
- confidence
# ---------- INFERENCE ----------
inference:
IF triple = (S, rdf:type, C)
THEN infer S instance_of C
according_to applicable entailment semantics
IF vocabulary defines subproperty or subclass relationships
THEN additional triples MAY be inferred
according_to declared entailment regime
IF same RDF graph is represented in different serialisations
THEN treat representations as semantically equivalent
where graph isomorphism or dataset equivalence is established
IF blank-node correspondence is unresolved
THEN preserve separate node identities
AND do_not force merge
IF graph semantics remain ambiguous
THEN preserve raw triples and graph context
AND reduce confidence
# ---------- OUTPUT CONTRACT ----------
output:
ontology_entity: RDFMetadata
RDF_dataset_structure: machine_interpretable
triples: explicit
term_roles: validatable
IRIs_and_namespaces: preserved
blank_nodes: scope_aware
literals: datatype_and_language_aware
graphs: traversable
serialisations: distinguishable
entailment: explicit
asserted_inferred_distinction: preserved
validation: reportable
provenance: preserved
uncertainty: explicit
semantic_retrieval: enabled
end flow
Download Code
Copy to Clipboard