0

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 this for the result : result

Then i want to retrieve data using sparql, here is my code

>         PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>     PREFIX owl: <http://www.w3.org/2002/07/owl#>
>     PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
>     PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>     PREFIX mpasi:<http://www.semanticweb.org/astrid/ontologies/2019/5/mpasiv2#>
>     
>     SELECT ?resep_makanan ?usia_bayi
>       WHERE { ?resep_makanan mpasi:resep_untuk ?usia_bayi.
>     }

But i didnt get anything... whats wrong with my sparql?

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
  • I don't understand what you expect now. SPARQL is a query language for RDF data, you create some OWL axioms and an SWRL rule in your ontology. That's nothing SPARQL takes into account during execution without having some reasoning enabled. the only reasoning supported SPARQL engine in Protege is when using the Snap SPARQL view/plugin, but not the standard SPARQL tab. – UninformedUser Mar 02 '20 at 13:33
  • Also, I don't understand why you're using such an old version of Protege which isn't even supported anymore. I mean, latest version is what, `5.5.0`? – UninformedUser Mar 02 '20 at 13:36
  • i just get the same result when i tried using protege 5.5.0... maybe i need to add some prefix so i can get instance that generated by swrl? – Astrid Noviana Paradhita Mar 04 '20 at 06:13
  • i just try to use snap sparql plugin... did it have different syntax with standard sparql? – Astrid Noviana Paradhita Mar 04 '20 at 06:37
  • Thanks Mr. Kralin i get what i want using snap sparql... ^,^. But can i ask you one thing? what is the basic differences between snap sparql and standard sparql query? – Astrid Noviana Paradhita Mar 04 '20 at 07:24
  • It's just a different implementation. The Snap SPARQL plugin does support some kind of reasoning while the standard SPARQL tab in Protege does not. And your SWRL rule has to be processed by a reasoner, that's why you don't get result with the standard SPARQL tab - just because no reasoner is used at all then – UninformedUser Mar 04 '20 at 08:00

0 Answers0