hydra.rdf.shacl_rdf module

Serialize a SHACL ShapesGraph to RDF triples using the SHACL vocabulary.

hydra.rdf.shacl_rdf.boolean_node(b: bool) Node_

Create a boolean literal node.

hydra.rdf.shacl_rdf.common_constraint_to_triples(subj: Resource, cc: CommonConstraint) Sequence[Triple]

Serialize a CommonConstraint to triples.

hydra.rdf.shacl_rdf.common_properties_to_triples(subj: Resource, cp: CommonProperties) Sequence[Triple]

Serialize CommonProperties to triples.

hydra.rdf.shacl_rdf.definition_to_triples(d: Definition[Shape]) Sequence[Triple]

Serialize a Definition<Shape> to triples.

hydra.rdf.shacl_rdf.integer_node(n: int) Node_

Create an integer literal node.

hydra.rdf.shacl_rdf.iri_node(i: Iri) Node_

Create an IRI node.

hydra.rdf.shacl_rdf.iri_or_literal_to_node(il: IriOrLiteral) Node_

Convert an IriOrLiteral to an RDF Node.

hydra.rdf.shacl_rdf.iri_resource(i: Iri) Resource

Create an IRI resource.

hydra.rdf.shacl_rdf.node_kind_to_iri(nk: NodeKind) Iri

Convert a NodeKind to its SHACL IRI.

hydra.rdf.shacl_rdf.node_shape_to_triples(iri_: Iri, ns_: NodeShape) Sequence[Triple]

Serialize a NodeShape to triples.

hydra.rdf.shacl_rdf.property_ref_to_triples(subj: Resource, ref: object) Sequence[Triple]

Serialize a property shape reference (may be inline or named).

hydra.rdf.shacl_rdf.property_shape_constraint_to_triples(subj: Resource, psc: PropertyShapeConstraint) Sequence[Triple]

Serialize a PropertyShapeConstraint to triples.

hydra.rdf.shacl_rdf.property_shape_to_triples(subj: Resource, ps: PropertyShape) Sequence[Triple]

Serialize a PropertyShape to triples, given a subject resource (may be blank node).

hydra.rdf.shacl_rdf.rdf(local: str) Iri

Construct an IRI in the RDF namespace.

hydra.rdf.shacl_rdf.sh(local: str) Iri

Construct an IRI in the SHACL namespace.

hydra.rdf.shacl_rdf.shapes_graph_to_ntriples(sg: ShapesGraph) str

Convert a ShapesGraph to N-Triples string.

hydra.rdf.shacl_rdf.shapes_graph_to_triples(sg: ShapesGraph) Sequence[Triple]

Convert a ShapesGraph to RDF triples.

hydra.rdf.shacl_rdf.string_node(s: str) Node_

Create a string literal node.

hydra.rdf.shacl_rdf.triple_i_i_i(s: Iri, p: Iri, o: Iri) Triple

Create a triple from IRI subject, IRI predicate, and IRI object.

hydra.rdf.shacl_rdf.triple_i_i_n(s: Iri, p: Iri, o: Node_) Triple

Create a triple from IRI subject, IRI predicate, and node object.

hydra.rdf.shacl_rdf.triple_r_i_i(s: Resource, p: Iri, o: Iri) Triple

Create a triple from resource subject, IRI predicate, and IRI object.

hydra.rdf.shacl_rdf.triple_r_i_n(s: Resource, p: Iri, o: Node_) Triple

Create a triple from resource subject, IRI predicate, and node object.

hydra.rdf.shacl_rdf.triple_to_description(t: Triple) Description

Convert a single triple to a description (one triple per description).

hydra.rdf.shacl_rdf.xsd(local: str) Iri

Construct an IRI in the XML Schema namespace.