owlapy.swrl
Attributes
Classes
Represents a variable in SWRL syntax |
|
Represents a data variable in SWRL syntax |
|
Represents a individual variable in SWRL syntax |
|
Represents an Atom in SWRL syntax |
|
Represents a class atom in SWRL syntax |
|
Represents a data range atom in SWRL syntax |
|
Represents a property atom in SWRL syntax |
|
Represents an object property atom in SWRL syntax |
|
Represents a data property atom in SWRL syntax |
|
Represents a 'same-as' atom in SWRL syntax |
|
Represents a 'different-from' atom in SWRL syntax |
|
Represents a built-in atom in SWRL syntax |
|
Represents a rule in SWRL syntax |
Functions
|
Returns the right string format of a given argument depending on its type |
|
Returns the representation for a given argument |
Module Contents
- owlapy.swrl.BUILTINS = ['add', 'subtract', 'multiply', 'divide', 'mod', 'pow', 'abs', 'round', 'floor', 'ceiling',...
- owlapy.swrl.DATATYPES = ['decimal', 'integer', 'nonNegativeInteger', 'nonPositiveInteger', 'positiveInteger',...
- owlapy.swrl.SWRL = 'http://www.w3.org/2003/11/swrl#'
- owlapy.swrl.SWRLB = 'http://www.w3.org/2003/11/swrlb#'
- class owlapy.swrl.Variable(iri: owlapy.iri.IRI | str)[source]
Represents a variable in SWRL syntax
- iri: owlapy.iri.IRI
- class owlapy.swrl.DVariable(iri: owlapy.iri.IRI | str)[source]
Bases:
VariableRepresents a data variable in SWRL syntax
- class owlapy.swrl.IVariable(iri: owlapy.iri.IRI | str)[source]
Bases:
VariableRepresents a individual variable in SWRL syntax
- class owlapy.swrl.Atom[source]
Represents an Atom in SWRL syntax
- owlapy.swrl.r(argument)[source]
Returns the right string format of a given argument depending on its type
- class owlapy.swrl.ClassAtom(cls: owlapy.class_expression.OWLClass, argument1: IVariable | owlapy.owl_individual.OWLNamedIndividual)[source]
Bases:
AtomRepresents a class atom in SWRL syntax
- argument1: IVariable | owlapy.owl_individual.OWLNamedIndividual
- class owlapy.swrl.DataRangeAtom(datatype: owlapy.owl_datatype.OWLDatatype, argument1: DVariable)[source]
Bases:
AtomRepresents a data range atom in SWRL syntax
- datatype: owlapy.owl_datatype.OWLDatatype
- class owlapy.swrl.PropertyAtom(prop: owlapy.owl_property.OWLObjectProperty | owlapy.owl_property.OWLDataProperty, argument1, argument2)[source]
Bases:
AtomRepresents a property atom in SWRL syntax
- argument1
- argument2
- prop
- class owlapy.swrl.ObjectPropertyAtom(prop: owlapy.owl_property.OWLObjectProperty, argument1: owlapy.owl_individual.OWLNamedIndividual | IVariable, argument2: owlapy.owl_individual.OWLNamedIndividual | IVariable)[source]
Bases:
PropertyAtomRepresents an object property atom in SWRL syntax
- argument1: owlapy.owl_individual.OWLNamedIndividual | IVariable
- argument2: owlapy.owl_individual.OWLNamedIndividual | IVariable
- class owlapy.swrl.DataPropertyAtom(prop: owlapy.owl_property.OWLDataProperty, argument1: owlapy.owl_individual.OWLNamedIndividual | IVariable, argument2: owlapy.owl_literal.OWLLiteral | DVariable)[source]
Bases:
PropertyAtomRepresents a data property atom in SWRL syntax
- argument1: owlapy.owl_individual.OWLNamedIndividual | IVariable
- argument2: owlapy.owl_literal.OWLLiteral | DVariable
- class owlapy.swrl.SameAsAtom(argument1: IVariable | owlapy.owl_individual.OWLNamedIndividual, argument2: IVariable | owlapy.owl_individual.OWLNamedIndividual)[source]
Bases:
AtomRepresents a ‘same-as’ atom in SWRL syntax
- argument1: IVariable | owlapy.owl_individual.OWLNamedIndividual
- argument2: IVariable | owlapy.owl_individual.OWLNamedIndividual
- class owlapy.swrl.DifferentFromAtom(argument1: IVariable | owlapy.owl_individual.OWLNamedIndividual, argument2: IVariable | owlapy.owl_individual.OWLNamedIndividual)[source]
Bases:
AtomRepresents a ‘different-from’ atom in SWRL syntax
- argument1: IVariable | owlapy.owl_individual.OWLNamedIndividual
- argument2: IVariable | owlapy.owl_individual.OWLNamedIndividual
- class owlapy.swrl.BuiltInAtom(predicate: owlapy.iri.IRI, arguments: List[DVariable | owlapy.owl_literal.OWLLiteral])[source]
Bases:
AtomRepresents a built-in atom in SWRL syntax
- predicate: owlapy.iri.IRI
- arguments: List[DVariable | owlapy.owl_literal.OWLLiteral]
- class owlapy.swrl.Rule(body_atoms: Atom | List[Atom], head_atoms: Atom | List[Atom])[source]
Represents a rule in SWRL syntax
- body
- head
- static from_string(rule: str, namespace: str, dp_predicates: List[str] = None)[source]
Parses a SWRL rule given as a string. Use ‘^’ for composition of atoms and ‘->’ for consequent implication. E.g. of a valid rule: ‘parent(?x,?y) ^ brother(?y,?z) -> uncle(?x,?z)’
- Parameters:
rule – The SWRL rule in string format that is to be parsed
namespace – The namespace of the ontology
dp_predicates – (optional) List of data property predicates that will help in the correct mapping of property type (by default property atoms are considered as object property atoms except when specifying data property predicates in this argument)
- Returns:
A SWRL Rule object.