rdfcrate.vocabs.owl
AllDifferent
Bases: Resource
AllDisjointClasses
Bases: Resource
AllDisjointProperties
Bases: Resource
Annotation
Bases: Resource
AnnotationProperty
Bases: Property
AsymmetricProperty
Bases: ObjectProperty
Axiom
Bases: Resource
Class
Bases: Class
DataRange
Bases: Datatype
DatatypeProperty
Bases: Property
DeprecatedClass
Bases: Class
DeprecatedProperty
Bases: Property
FunctionalProperty
Bases: Property
InverseFunctionalProperty
Bases: ObjectProperty
IrreflexiveProperty
Bases: ObjectProperty
NamedIndividual
Bases: Thing
NegativePropertyAssertion
Bases: Resource
Nothing
Bases: Thing
ObjectProperty
Bases: Property
Ontology
Bases: Resource
OntologyProperty
Bases: Property
RdfClass
Bases: RdfType
An RDF entity that has a URI (or blank node).
Typically these are instance of rdfs:Class
or owl:Class
.
add(*args: EntityArgs, graph: ContextGraph | None = None) -> ContextGraph
Adds triples to a graph with this entity as the subject.
If the graph is not provided, an empty one will be created and returned.
Example
from rdfcrate import ContextGraph, rdfs, sdo
graph = ContextGraph() sdo.Thing("http://example.org/thing").add( sdo.name("My Thing"), sdo.description("An example thing"), graph=graph )
adhoc(term: RdfTerm) -> type[Self]
classmethod
Makes an ad-hoc type class from a term.
to_type_property() -> rdf.type
classmethod
Converts this class wrapper to an instance of RdfProperty
that can be used to tag entities with this type.
update(*args: EntityArgs, graph: ContextGraph | None = None) -> ContextGraph
Updates this entity with the given properties, in a graph.
If the graph is not provided, an empty one will be created and returned.
with_term_label(label: str) -> type[RdfClass]
classmethod
Creates a new instance of this class with the given label. This is useful in cases where the term label is already defined by another vocabulary
RdfProperty
dataclass
Bases: PropertyProtocol
, Generic[T]
Represents the double of (predicate, object), with the subject being the class this is attached to.
This is the normal way properties will be defined As a user, you will typically use this class by instantiating subclasses from the vocabs module and attaching them to entities. If you want to define custom vocabulary, you can first subclass this and then create instances of that subclass.
adhoc(term: RdfTerm, object: T) -> RdfProperty
staticmethod
Makes an ad-hoc property class from a term.
If you want to use the property multiple times, you should define a subclass instead.
reverse(subject: RdfType) -> ReverseProperty
classmethod
Utility for when you want to make the current entity the object of a property, rather than the subject.
with_term_label(label: str) -> type[RdfProperty[T]]
classmethod
Creates a new instance of this property with the given label. This is useful in cases where the term label is already defined by another vocabulary
RdfTerm
Wrapper for a term with a label and URI. This is needed because RO-Crate bans the use of full URIs in JSON-LD.
RdfType
An entity within the RDF graph.
This is a thin wrapper around a rdflib
Identifier
such as a URIRef
or BNode
, but which allows for static type checking.
as_object(graph: ContextGraph, subject: Subject, predicate: Predicate) -> Object
Converts this entity to an Object
that can be used in triples.
as_subject(graph: ContextGraph, predicate: Predicate, object: Object) -> Subject
Converts this entity to a Subject
that can be used in triples.
ReflexiveProperty
Bases: ObjectProperty
Restriction
Bases: Class
SymmetricProperty
Bases: ObjectProperty
Thing
Bases: RdfClass
TransitiveProperty
Bases: ObjectProperty
allValuesFrom
dataclass
Bases: RdfProperty[Class]
annotatedProperty
dataclass
Bases: RdfProperty[Resource]
annotatedSource
dataclass
Bases: RdfProperty[Resource]
annotatedTarget
dataclass
Bases: RdfProperty[Resource]
assertionProperty
dataclass
Bases: RdfProperty[Property]
backwardCompatibleWith
dataclass
Bases: RdfProperty[Ontology]
bottomDataProperty
dataclass
Bases: RdfProperty[Literal]
bottomObjectProperty
dataclass
Bases: RdfProperty[Thing]
cardinality
dataclass
Bases: RdfProperty[RdfType]
complementOf
dataclass
Bases: RdfProperty[Class]
datatypeComplementOf
dataclass
Bases: RdfProperty[Datatype]
deprecated
dataclass
Bases: RdfProperty[Resource]
differentFrom
dataclass
Bases: RdfProperty[Thing]
disjointUnionOf
dataclass
Bases: RdfProperty[List]
disjointWith
dataclass
Bases: RdfProperty[Class]
distinctMembers
dataclass
Bases: RdfProperty[List]
equivalentClass
dataclass
Bases: RdfProperty[Class]
equivalentProperty
dataclass
Bases: RdfProperty[Property]
hasKey
dataclass
Bases: RdfProperty[List]
hasSelf
dataclass
Bases: RdfProperty[Resource]
hasValue
dataclass
Bases: RdfProperty[Resource]
imports
dataclass
Bases: RdfProperty[Ontology]
incompatibleWith
dataclass
Bases: RdfProperty[Ontology]
intersectionOf
dataclass
Bases: RdfProperty[List]
inverseOf
dataclass
Bases: RdfProperty[ObjectProperty]
maxCardinality
dataclass
Bases: RdfProperty[RdfType]
maxQualifiedCardinality
dataclass
Bases: RdfProperty[RdfType]
members
dataclass
Bases: RdfProperty[List]
minCardinality
dataclass
Bases: RdfProperty[RdfType]
minQualifiedCardinality
dataclass
Bases: RdfProperty[RdfType]
onClass
dataclass
Bases: RdfProperty[Class]
onDataRange
dataclass
Bases: RdfProperty[Datatype]
onDatatype
dataclass
Bases: RdfProperty[Datatype]
onProperties
dataclass
Bases: RdfProperty[List]
onProperty
dataclass
Bases: RdfProperty[Property]
oneOf
dataclass
Bases: RdfProperty[List]
priorVersion
dataclass
Bases: RdfProperty[Ontology]
propertyChainAxiom
dataclass
Bases: RdfProperty[List]
propertyDisjointWith
dataclass
Bases: RdfProperty[Property]
qualifiedCardinality
dataclass
Bases: RdfProperty[RdfType]
sameAs
dataclass
Bases: RdfProperty[Thing]
someValuesFrom
dataclass
Bases: RdfProperty[Class]
sourceIndividual
dataclass
Bases: RdfProperty[Thing]
targetIndividual
dataclass
Bases: RdfProperty[Thing]
targetValue
dataclass
Bases: RdfProperty[Literal]
topDataProperty
dataclass
Bases: RdfProperty[Literal]
topObjectProperty
dataclass
Bases: RdfProperty[Thing]
unionOf
dataclass
Bases: RdfProperty[List]
versionIRI
dataclass
Bases: RdfProperty[Ontology]
versionInfo
dataclass
Bases: RdfProperty[Resource]
withRestrictions
dataclass
Bases: RdfProperty[List]