Create TBOX with SQWRL

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

Create TBOX with SQWRL

tomekldc
Hi,

I'm using OWL API and SWRL API.
I want to generate a new ontology exclusively with queries (could be SPARQL
as well, but OWL API and SPARQL-DL doesn't offer a way to INSERT DATA ).

I've read the Wiki of the SWRL API :
https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
<https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary>  
I'm not sure the SWRLX Extensions built-in library could do the trick as it
could only create individuals ?

And I've read most of the topics about inserting new entities (class,
individuals) and proprieties with SPARQL Queries but unfortunately it's only
based on Jena (Fuzeki Server).

Do you have a suggestion for creating new classes, individuals (and
properties) with queries ?  




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Create TBOX with SQWRL

Igor Toujilov-2
With OWL API you can do it only in Java: write a Java program to load an ontology, query it, and use the query results to add new entities to the ontology with the help of OWL API (all of this in the Java program).
In early Protégé 4 versions there was an Ontology Preprocessing Language (OPPL2) plug-in, which allowed writing an OPPL script to query an ontology and generate new entities in it. But I don’t think this plug-in is still supported or even working with current Protégé versions.

Cheers,
Igor


> Sent: Tuesday, May 12, 2020 at 12:25 PM
> From: "tomekldc" <[hidden email]>
> To: [hidden email]
> Subject: [protege-user] Create TBOX with SQWRL
>
> Hi,
>
> I'm using OWL API and SWRL API.
> I want to generate a new ontology exclusively with queries (could be SPARQL
> as well, but OWL API and SPARQL-DL doesn't offer a way to INSERT DATA ).
>
> I've read the Wiki of the SWRL API :
> https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
> <https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary>  
> I'm not sure the SWRLX Extensions built-in library could do the trick as it
> could only create individuals ?
>
> And I've read most of the topics about inserting new entities (class,
> individuals) and proprieties with SPARQL Queries but unfortunately it's only
> based on Jena (Fuzeki Server).
>
> Do you have a suggestion for creating new classes, individuals (and
> properties) with queries ?  
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user
>
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Create TBOX with SQWRL

Michael DeBellis-2
In reply to this post by tomekldc
 You definitely can't use SQWRL. See the documentation here:  https://github.com/protegeproject/swrlapi/wiki/SQWRL     SQWRL is strictly for queries and can't insert any information at all (e.g., not even new values for properties on Individuals) into the ontology. 

makeOWLThing is only for creating Individuals. See: https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary   "makeOWLThing This built-in provides a controlled way of creating OWL individuals in a rule"

But I think you can use INSERT DATA and INSERT in SPARQL to create classes and properties. I'm not familiar with SPARQL DL but I think standard SPARQL should be able to do this. A new class or property is just another triple such as "NewClass a owl:Class;". 

On Tue, May 12, 2020 at 4:26 AM tomekldc <[hidden email]> wrote:
Hi,

I'm using OWL API and SWRL API.
I want to generate a new ontology exclusively with queries (could be SPARQL
as well, but OWL API and SPARQL-DL doesn't offer a way to INSERT DATA ).

I've read the Wiki of the SWRL API :
https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
<https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
I'm not sure the SWRLX Extensions built-in library could do the trick as it
could only create individuals ?

And I've read most of the topics about inserting new entities (class,
individuals) and proprieties with SPARQL Queries but unfortunately it's only
based on Jena (Fuzeki Server).

Do you have a suggestion for creating new classes, individuals (and
properties) with queries ? 




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Create TBOX with SQWRL

Lorenz Buehmann

As said before

1) use text editor or Protege

2) use OWL API and write Java code that adds the axioms

3) use SPARQL 1.1 Update queries

On 12.05.20 17:55, Michael DeBellis wrote:
 You definitely can't use SQWRL. See the documentation here:  https://github.com/protegeproject/swrlapi/wiki/SQWRL     SQWRL is strictly for queries and can't insert any information at all (e.g., not even new values for properties on Individuals) into the ontology. 

makeOWLThing is only for creating Individuals. See: https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary   "makeOWLThing This built-in provides a controlled way of creating OWL individuals in a rule"

But I think you can use INSERT DATA and INSERT in SPARQL to create classes and properties. I'm not familiar with SPARQL DL but I think standard SPARQL should be able to do this. A new class or property is just another triple such as "NewClass a owl:Class;". 

On Tue, May 12, 2020 at 4:26 AM tomekldc <[hidden email]> wrote:
Hi,

I'm using OWL API and SWRL API.
I want to generate a new ontology exclusively with queries (could be SPARQL
as well, but OWL API and SPARQL-DL doesn't offer a way to INSERT DATA ).

I've read the Wiki of the SWRL API :
https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
<https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
I'm not sure the SWRLX Extensions built-in library could do the trick as it
could only create individuals ?

And I've read most of the topics about inserting new entities (class,
individuals) and proprieties with SPARQL Queries but unfortunately it's only
based on Jena (Fuzeki Server).

Do you have a suggestion for creating new classes, individuals (and
properties) with queries ? 




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Create TBOX with SQWRL

tomekldc
In reply to this post by Michael DeBellis-2
Hi,

Thank you Igor and Michael for your answers.

I'm trying to avoid using java programming to translate the results of the
queries to java (OWL API) insert data because it could lead to specific
cases of translation I could not have handled - I need a standard syntax
that can be use on any ontology.

Ontology Preprocessing Language ( OPPL2 <https://github.com/owlcs/OPPL2>  )
as suggested Igor could be way to go. I need to check in practise if it
still compatible with OWL API 4 (it is for OWL API 3 at least).

I can understand that SQWRL is only a query language but using library like
SWLRX <http://rl.stanford.edu/ontologies/built-ins/3.3/swrlx.owl>  and their
methods are a bit confusing. Do they allow to create a OWLClass and a
OWLIndividual ?
/  <swrl:Builtin rdf:ID="makeOWLClass"/>
  <swrl:Builtin rdf:ID="makeOWLIndividual"/>/

As for SPARQL-DL, it's really good to handle all the expressivness of OWL
but I can't find a way to INSERT (I don't thinkg SPARQL-DL meet the SPARQL
1.1 requirements). ( SPARQL-DL Homepage
<https://www.derivo.de/en/resources/sparql-dl-api/sparql-dl-syntax/>   /
SPARQL-DL Github <https://github.com/protegeproject/sparql-dl-api>  )

I could otherwise use SPARQL (and INSERT DATA) with Jena but it is making me
add a new similar library (as OWL API) in my architecture.

I will keep searching and I will comeback to you if needed.
Thank you again for your time.




Michael DeBellis-2 wrote

> You definitely can't use SQWRL. See the documentation here:
> https://github.com/protegeproject/swrlapi/wiki/SQWRL     SQWRL is strictly
> for queries and can't insert any information at all (e.g., not even new
> values for properties on Individuals) into the ontology.
>
> makeOWLThing is only for creating Individuals. See:
> https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
>  "makeOWLThing This built-in provides a controlled way of creating OWL
> individuals in a rule"
>
> But I think you can use INSERT DATA and INSERT in SPARQL to create classes
> and properties. I'm not familiar with SPARQL DL but I think standard
> SPARQL
> should be able to do this. A new class or property is just another triple
> such as "NewClass a owl:Class;".
>
> On Tue, May 12, 2020 at 4:26 AM tomekldc &lt;

> tleduc001@

> &gt; wrote:
>
>> Hi,
>>
>> I'm using OWL API and SWRL API.
>> I want to generate a new ontology exclusively with queries (could be
>> SPARQL
>> as well, but OWL API and SPARQL-DL doesn't offer a way to INSERT DATA ).
>>
>> I've read the Wiki of the SWRL API :
>> https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
>> &lt;https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary&gt;
>>
>> I'm not sure the SWRLX Extensions built-in library could do the trick as
>> it
>> could only create individuals ?
>>
>> And I've read most of the topics about inserting new entities (class,
>> individuals) and proprieties with SPARQL Queries but unfortunately it's
>> only
>> based on Jena (Fuzeki Server).
>>
>> Do you have a suggestion for creating new classes, individuals (and
>> properties) with queries ?
>>
>>
>>
>>
>> --
>> Sent from:
>> http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
>> _______________________________________________
>> protege-user mailing list
>>

> protege-user@.stanford

>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>>
>
> _______________________________________________
> protege-user mailing list

> protege-user@.stanford

> https://mailman.stanford.edu/mailman/listinfo/protege-user





--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Create TBOX with SQWRL

Lorenz Buehmann
SPARQL-DL is not proper SPARQL nad has it's limitations. It's also pre
SPARQL 1.1, thus, there is no means of INSERT DATA etc.

For you the perfect match is a bridge project Ont API [1] which
conveniently lets you use OWL API and Jena in combination


[1] https://github.com/owlcs/ont-api

On 13.05.20 10:17, tomekldc wrote:

> Hi,
>
> Thank you Igor and Michael for your answers.
>
> I'm trying to avoid using java programming to translate the results of the
> queries to java (OWL API) insert data because it could lead to specific
> cases of translation I could not have handled - I need a standard syntax
> that can be use on any ontology.
>
> Ontology Preprocessing Language ( OPPL2 <https://github.com/owlcs/OPPL2>  )
> as suggested Igor could be way to go. I need to check in practise if it
> still compatible with OWL API 4 (it is for OWL API 3 at least).
>
> I can understand that SQWRL is only a query language but using library like
> SWLRX <http://rl.stanford.edu/ontologies/built-ins/3.3/swrlx.owl>  and their
> methods are a bit confusing. Do they allow to create a OWLClass and a
> OWLIndividual ?
> /  <swrl:Builtin rdf:ID="makeOWLClass"/>
>   <swrl:Builtin rdf:ID="makeOWLIndividual"/>/
>
> As for SPARQL-DL, it's really good to handle all the expressivness of OWL
> but I can't find a way to INSERT (I don't thinkg SPARQL-DL meet the SPARQL
> 1.1 requirements). ( SPARQL-DL Homepage
> <https://www.derivo.de/en/resources/sparql-dl-api/sparql-dl-syntax/>   /
> SPARQL-DL Github <https://github.com/protegeproject/sparql-dl-api>  )
>
> I could otherwise use SPARQL (and INSERT DATA) with Jena but it is making me
> add a new similar library (as OWL API) in my architecture.
>
> I will keep searching and I will comeback to you if needed.
> Thank you again for your time.
>
>
>
>
> Michael DeBellis-2 wrote
>> You definitely can't use SQWRL. See the documentation here:
>> https://github.com/protegeproject/swrlapi/wiki/SQWRL     SQWRL is strictly
>> for queries and can't insert any information at all (e.g., not even new
>> values for properties on Individuals) into the ontology.
>>
>> makeOWLThing is only for creating Individuals. See:
>> https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
>>  "makeOWLThing This built-in provides a controlled way of creating OWL
>> individuals in a rule"
>>
>> But I think you can use INSERT DATA and INSERT in SPARQL to create classes
>> and properties. I'm not familiar with SPARQL DL but I think standard
>> SPARQL
>> should be able to do this. A new class or property is just another triple
>> such as "NewClass a owl:Class;".
>>
>> On Tue, May 12, 2020 at 4:26 AM tomekldc &lt;
>> tleduc001@
>> &gt; wrote:
>>
>>> Hi,
>>>
>>> I'm using OWL API and SWRL API.
>>> I want to generate a new ontology exclusively with queries (could be
>>> SPARQL
>>> as well, but OWL API and SPARQL-DL doesn't offer a way to INSERT DATA ).
>>>
>>> I've read the Wiki of the SWRL API :
>>> https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary
>>> &lt;https://github.com/protegeproject/swrlapi/wiki/ExtensionsBuiltInLibrary&gt;
>>>
>>> I'm not sure the SWRLX Extensions built-in library could do the trick as
>>> it
>>> could only create individuals ?
>>>
>>> And I've read most of the topics about inserting new entities (class,
>>> individuals) and proprieties with SPARQL Queries but unfortunately it's
>>> only
>>> based on Jena (Fuzeki Server).
>>>
>>> Do you have a suggestion for creating new classes, individuals (and
>>> properties) with queries ?
>>>
>>>
>>>
>>>
>>> --
>>> Sent from:
>>> http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
>>> _______________________________________________
>>> protege-user mailing list
>>>
>> protege-user@.stanford
>>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>>>
>> _______________________________________________
>> protege-user mailing list
>> protege-user@.stanford
>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Create TBOX with SQWRL

tomekldc
Hi,

Thank you Lorenz for your answers.

I will dig into Ont API with hope that, as it uses OWL API, SWRL API could
be used as well in the architecture.

Cheers,




--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user