"beta" SPQRQL queries on inferred model

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

"beta" SPQRQL queries on inferred model

Massimo Coletti
Hi Rinke,

I saw a previous thread where you were offering this new development.

I would like to use protege as a knowledge acquisition system, to build a modularized set of ontologies representing information security and privacy concepts in our Company. I will use this KB as a working repository, and extract some relevant subset of information using SPARQL queries. The ability to work on the inferred model would be a great advance, because now I have to implement inference paths inside the SPARQL queries, duplicating some knowledge that is implicit in the model.

The second issue that I have is saving the result of the SPARQL Query, in some XML-based format, in order to publish them on a website. I understand that the only way - now - is to build some chunks of code, invoking the

executeSPARQLQuery

method.

Can someone provide me with a minimal example (load an OWL project from file, execute an hardcoded query), as I have never worked before on Protégé API.

Thanks,

Massimo Coletti

massimo <dot> coletti <at> gmail <dot> com

Reply | Threaded
Open this post in threaded view
|

Re: "beta" SPQRQL queries on inferred model

Rinke Hoekstra-3
Hi Massimo,

Unfortunately I have not had the chance to fully test the functionality,
and I do not know whether it will still work in the latest beta. As
usual other work got in the way.

A sparql query is usually done on a Jena Model version of the
Protege-OWL ontology representation. What I did was change the Model to
an InfModel... this seemed to work fine. However, it requires you to
trace the behavior of the executeSPARQLQuery method, and make all
necessary changes.

I will have a look, but cannot promise anything.

-Rinke

Massimo Coletti wrote:

> Hi Rinke,
>
> I saw a previous thread where you were offering this new development.
>
> I would like to use protege as a knowledge acquisition system, to build
> a modularized set of ontologies representing information security and
> privacy concepts in our Company. I will use this KB as a working
> repository, and extract some relevant subset of information using SPARQL
> queries. The ability to work on the inferred model would be a great
> advance, because now I have to implement inference paths inside the
> SPARQL queries, duplicating some knowledge that is implicit in the model.
>
> The second issue that I have is saving the result of the SPARQL Query,
> in some XML-based format, in order to publish them on a website. I
> understand that the only way - now - is to build some chunks of code,
> invoking the
>
>
>       executeSPARQLQuery
>
> method.
>
> Can someone provide me with a minimal example (load an OWL project from
> file, execute an hardcoded query), as I have never worked before on
> Protégé API.
>
> Thanks,
>
> Massimo Coletti
>
> massimo <dot> coletti <at> gmail <dot> com
>

--
--------------------------------------
Rinke Hoekstra         [hidden email]
T: +31-20-5253499    F: +31-20-5253495
Leibniz Center for Law,    Law Faculty
University of Amsterdam,   PO Box 1030
1000 BA  Amsterdam,    The Netherlands
--------------------------------------

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html

Reply | Threaded
Open this post in threaded view
|

Re: "beta" SPQRQL queries on inferred model

Massimo Coletti
In reply to this post by Massimo Coletti
If someone is interested, the following code snipped was used to open an
existing OWL project, and execute a SPARQL query on it. At the present
time, the query output was only of simple datatypes, so I have exported
it on a textfile - it was enough for me.

         String myfile = "dps196_inv.pprj";
           Collection errors = new ArrayList();
            Project project = new Project(myfile, errors);
            OWLModel kb = (OWLModel) project.getKnowledgeBase();
            try {
                QueryResults qr = kb.executeSPARQLQuery(RICHIESTA);

(I will experiment with the inferred model....)

Massimo

Massimo Coletti ha scritto:

> Hi Rinke,
>
> I saw a previous thread where you were offering this new development.
>
> I would like to use protege as a knowledge acquisition system, to
> build a modularized set of ontologies representing information
> security and privacy concepts in our Company. I will use this KB as a
> working repository, and extract some relevant subset of information
> using SPARQL queries. The ability to work on the inferred model would
> be a great advance, because now I have to implement inference paths
> inside the SPARQL queries, duplicating some knowledge that is implicit
> in the model.
>
> The second issue that I have is saving the result of the SPARQL Query,
> in some XML-based format, in order to publish them on a website. I
> understand that the only way - now - is to build some chunks of code,
> invoking the
>
>
>       executeSPARQLQuery
>
> method.
>
> Can someone provide me with a minimal example (load an OWL project
> from file, execute an hardcoded query), as I have never worked before
> on Protégé API.
>
> Thanks,
>
> Massimo Coletti
>
> massimo <dot> coletti <at> gmail <dot> com
>

-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html