Questions tagged [swrl]

SWRL (Semantic Web Rule Language) is a proposed semantic rule language based on combination of OWL-DL with Rule-ML.

SWRL is the Semantic Web Rule Language, formulated as a combination of OWL and RuleML. SWRL extends the definition of OWL axioms with Horn-like rules, thereby allowing additional inference capabilities, basic mathematical functionality and provide a formal meaning in an ontology. It was submitted to the W3C on 21 May 2004.

Rules take the form of logical implication with a rule antecedent(body) and rule consequent(head), each of which is composed of zero or more "atoms". These rules are read as "If the antecedent holds true then perform the actions in the consequent".

Rules can be expressed in a high level abstract syntax to express the Horn-like rules in OWL-Lite or OWL-DL or in the form of XML based syntax. The XML syntax based on RuleML and the OWL XML Presentation Syntax as well as an RDF concrete syntax based on the OWL RDF/XML exchange syntax.

The Official SWRL reference :
SWRL: A Semantic Web Rule Language Combining OWL and RuleML

Tools to write SWRL rules:
1)
2) Any text editor

Additional References:
1)
2)RuleML

173 questions
0
votes
1 answer

Infer Anonymous class in Protege with the Rules Tab

I would like to infer an anonymous class definition for my Individuals in Protege. I have a simple Ontology with the Classes Rain NoRain and Scene, The object Property has_weather. My desire is to be able to infer "has_weather(?x, ?noRain),…
0
votes
0 answers

addition of rules and value assigning in an ontology

Say a degree recommendation ontology which is supposed to recommend a degree programme according to certain set of results you get for an exam. E.g. a students chooses a stream he did the exam in and his results are: for chemistry, physics, and…
0
votes
0 answers

SWRL: Variables to represent classes (rule to get instance of parent class or subclass)

I have the following setting: an owl-ontology (accessed via owlready with this class hierarchy: owl:Thing ├── ClassA1 └── ClassB1 └── ClassB2 └── ClassB3 └── ClassB4 one instance of each class, say A1, B1 , etc. a…
cknoll
  • 2,130
  • 4
  • 18
  • 34
0
votes
1 answer

Cast OWL-S condition to SWRL

I want to cast some OWL-S conditions to SWRL, the cast is done but the result manipulation returns nullpointerexception. Here the code : final OWLIndividualList cs = service.getProfile().getConditions(); final ArrayList>…
Moh Lamine
  • 72
  • 1
  • 9
0
votes
1 answer

OWL-S Precondition expression extracting

I am trying to extract the precondition's expression as SWRL to make a IOPE web service OWL-S matchmaking Here's my code final OWLIndividualList cs = service.getProcess().getConditions(); final ArrayList> conditions = new…
Moh Lamine
  • 72
  • 1
  • 9
0
votes
0 answers

SWRL:not expecting an unbound argument for (0-offset) argument #1

I'm trying to run this code on sqwrl tab in protege 5.5.0,but there is an error: swrlb:date("2010-10-10Z"^^xsd:date, ?a, ?b, ?c, ?d) -> sqwrl:select(?a) error: Exception running SQWRL query S5: error running SQWRL queries: error transferring…
alex
  • 7,551
  • 13
  • 48
  • 80
0
votes
0 answers

How to write snap SPARQL Query when using Pellet as reasoner

i learn ontologies for study purposes. Here i encontered problem when querying. i use pellet as reasoner, because i did some swrl builts-in here i has class named resep_makanan and i want to get all its instance so i write PREFIX owl:…
0
votes
0 answers

sparql to access swrl

im still a newbe for implementing swrl using protege 4.3 Here i have class resep_makanan and class usia_bayi. the two class connected by each other through object property. memiliki_resep resep_untuk Then i make swrl like this : swrl : Then i get…
0
votes
1 answer

Does SWRL support classical negation in Protege?

I wanted to try the following rule: (not Person)(?x) -> NonHuman(?x) which is provided here - https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ#does-swrl-support-classical-negation and i got this: Is classical negation supported in…
mastaofthepasta
  • 91
  • 1
  • 2
  • 9
0
votes
1 answer

Protege: Anonymous class to subsume all classes not participate in a relation

Suppose there is 4 classes: a,b,c, d. and we have a has_relation some b. I can define c as : has_relation some b to subsume a as its subclass. but what if i want that the c to have d as its subclass. (I know not(a has_relation some b)…
alex
  • 7,551
  • 13
  • 48
  • 80
0
votes
1 answer

SWRL - Unable to substract date time by duration

I'm trying to implement a rule that substract 1 years to a datetime and asign it to a data property using only SWRL I've got an entity Product which got a data property creationDate equal to 2019-07-15T00:00:00. My SWRL rule is the following…
Dauflo
  • 31
  • 1
  • 7
0
votes
0 answers

How to compare datetime duration in swrl?

Say i have an individual has a starts_at datetime property, then i want to compare it's value with the current datetime in ontology using SWRL rules I looked at time ontology in W3C, then i found the SWRLTemporalOntology from built in SWRL Rules,…
Taha
  • 61
  • 3
0
votes
2 answers

SWRL rule does not the right thing

I have an ontology wishing Protege and now I would like to implement rules. I have an individual that has a literal PANEL = "R1-2B". I like to formulate a rule that if this value is "R1-2" then this individual has the object property…
mixi
  • 19
  • 2
0
votes
2 answers

OWL-API 5.1.6 SWRL rule generation and RDFXMLDocumentFormat : rules are merged

What: I'm facing what i'm calling an issue, but it's probably not. For some needs, i'm creating a serie of swrl rules through OWL API, which after been serialized will be added to a stardog repository by simple file upload. For example purpose, i…
robotte
  • 103
  • 6
0
votes
2 answers

How to process SWRL rules using Openllet and OWL api?

I've been trying to set up a query printer a lot like this: https://github.com/owlcs/owlapi/wiki/DL-Queries-with-a-real-reasoner where if I give it a query in Manchester syntax I can get a response that mirrors what I would get back in protege. I…
topfoxrider
  • 143
  • 10