countMatches syntax question #732
-
|
I am trying to use countMatches in a rule where I want to have the triple of the form "a variable of type T1". I was not able to get the syntax part correct for "type" in the following, I tried prefixing it but did not succeed. Rule ErrorSignal2R |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
@AbhaMoitra , I'm glad you asked this question. It is a good illustration of how to use owl, rdf, or rdfs concepts that are not available in the SADL grammar in a SADL model. In some cases, the SADL grammar expresses such a concept, e.g., "Felix is a Cat" expresses the triple <Felix, rdf:type, Cat>. In your case, however, you want to express the property "rdf:type" directly as a function argument and to use it in this way you must first import an ontology that defines it. You could get the entire RDF ontology and import it, or you can create your own subset of RDF and import that. Taking the later approach, and doing the minimum, I define this simple model: Now I can import this RDF-subset ontology and use the concept "rdf:type": |
Beta Was this translation helpful? Give feedback.
-
|
Or, since in SADL we write things like "x is a Thing" instead of "x rdf:type Thing", maybe we should have another builtin: countInstances(Thing) |
Beta Was this translation helpful? Give feedback.
-
|
I've already added it to the Topical Index, under topic title RDF, RDFS, OWL Concepts, Referencing in Expressions. |
Beta Was this translation helpful? Give feedback.



@AbhaMoitra , I'm glad you asked this question. It is a good illustration of how to use owl, rdf, or rdfs concepts that are not available in the SADL grammar in a SADL model. In some cases, the SADL grammar expresses such a concept, e.g., "Felix is a Cat" expresses the triple <Felix, rdf:type, Cat>. In your case, however, you want to express the property "rdf:type" directly as a function argument and to use it in this way you must first import an ontology that defines it. You could get the entire RDF ontology and import it, or you can create your own subset of RDF and import that. Taking the later approach, and doing the minimum, I define this simple model:
.
Note that the namespace must …