You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Vinicios Binsfeld <vi...@gmail.com> on 2014/09/01 14:06:10 UTC

SDB with MySQL and Java

Hello.

Someone has any examples of how popular one with OWL ontology data using
SDB?

I'm using MySQL and SDB data. The connection with the database is working
well. Now I need an example of how populate the ontology and how to
manipulate, fetch data, update data, and create new records.



--

RE: SDB with MySQL and Java

Posted by "John A. Fereira" <ja...@cornell.edu>.
I don’t know much about SWRL rules but the native four tables in the SQL database that sit behind the Jena SDB are just the storage mechanism that Jena is using and going through Jena to access that data rather direct queries the database would be preferred.

D2RQ would be used for mapping existing data in some other external relational database to your ontology and then Jena used to load the RDF into the triplestore.  Once the data is in the triple store you wouldn’t need to use D2RQ again.

From: Vinicios Binsfeld [mailto:viniciosbinsfeld@gmail.com]
Sent: Tuesday, September 02, 2014 10:07 PM
To: users; John A. Fereira
Cc: dev
Subject: Re: SDB with MySQL and Java

Hi John.

I will need to create some SWRL rules on the data present in the ontology, then I need to use the native four tables of Jena SDB or could maybe use D2RQ or VITRO to do the queries using SWRL?

2014-09-02 10:44 GMT-03:00 John A. Fereira <ja...@cornell.edu>>:
It's not clear to me what you're trying to do.

Is the MySQL database you mention the database that sits behind the Jena SDB triple store.  That database would have four tables (nodes, prefixes, quads, triples) and wouldn't be a database that you would access directly using SQL queries.

If, however, you're talking about a separate MySQL database that contains the data, in tabular format that you want map to your ontology you have several options.

As Andy mentioned in an earlier thread the D2RQ project (http://d2rq.org/jena) can map tabular data in a database into RDF that can be loaded into a SDB.

Another project that a lot of people are finding useful is Karma (http://isi.edu/integration/karma/)  I has a GUI which allows you to load in an ontology, then import data from a variety of formats (including establishing a MySQL database connection and executing SQL to grab data).  Then it uses a nice UI which can map the data in each column to the appropriate classes and properties in your ontology.  Then once you're done it can "publish" your data to a Jena SDB instance.

Another project, for which I recently became the maintainer is something called VIVO-Harvester (https://github.com/vivo-project/VIVO-Harvester).  Although it's intended to be used with VIVO (a semantic web application: http://www.vivoweb.org/) it is basically a suite of tools that will take data from a variety of datasources (including a MySql database), transformed that data to RDF, then load it into a triple store.

Finally, the VIVO software is actually built on top of something called Vitro (https://github.com/vivo-project/Vitro) , which is basically a copy of VIVO without the VIVO (and associated ontologies) built in.  Using Vitro you could load in your own ontology and then use the available ingest tools (or  the VIVO-Harvester) to load in your data.

-----Original Message-----
From: Vinicios Binsfeld [mailto:viniciosbinsfeld@gmail.com<ma...@gmail.com>]
Sent: Monday, September 01, 2014 8:06 AM
To: dev; users
Subject: SDB with MySQL and Java

Hello.

Someone has any examples of how popular one with OWL ontology data using SDB?

I'm using MySQL and SDB data. The connection with the database is working well. Now I need an example of how populate the ontology and how to manipulate, fetch data, update data, and create new records.



--



--
Atenciosamente,
Vinicios Adonis Binsfeld
E-mail  / Google Talk : viniciosbinsfeld@gmail.com<ma...@gmail.com>


RE: SDB with MySQL and Java

Posted by "John A. Fereira" <ja...@cornell.edu>.
I don’t know much about SWRL rules but the native four tables in the SQL database that sit behind the Jena SDB are just the storage mechanism that Jena is using and going through Jena to access that data rather direct queries the database would be preferred.

D2RQ would be used for mapping existing data in some other external relational database to your ontology and then Jena used to load the RDF into the triplestore.  Once the data is in the triple store you wouldn’t need to use D2RQ again.

From: Vinicios Binsfeld [mailto:viniciosbinsfeld@gmail.com]
Sent: Tuesday, September 02, 2014 10:07 PM
To: users; John A. Fereira
Cc: dev
Subject: Re: SDB with MySQL and Java

Hi John.

I will need to create some SWRL rules on the data present in the ontology, then I need to use the native four tables of Jena SDB or could maybe use D2RQ or VITRO to do the queries using SWRL?

2014-09-02 10:44 GMT-03:00 John A. Fereira <ja...@cornell.edu>>:
It's not clear to me what you're trying to do.

Is the MySQL database you mention the database that sits behind the Jena SDB triple store.  That database would have four tables (nodes, prefixes, quads, triples) and wouldn't be a database that you would access directly using SQL queries.

If, however, you're talking about a separate MySQL database that contains the data, in tabular format that you want map to your ontology you have several options.

As Andy mentioned in an earlier thread the D2RQ project (http://d2rq.org/jena) can map tabular data in a database into RDF that can be loaded into a SDB.

Another project that a lot of people are finding useful is Karma (http://isi.edu/integration/karma/)  I has a GUI which allows you to load in an ontology, then import data from a variety of formats (including establishing a MySQL database connection and executing SQL to grab data).  Then it uses a nice UI which can map the data in each column to the appropriate classes and properties in your ontology.  Then once you're done it can "publish" your data to a Jena SDB instance.

Another project, for which I recently became the maintainer is something called VIVO-Harvester (https://github.com/vivo-project/VIVO-Harvester).  Although it's intended to be used with VIVO (a semantic web application: http://www.vivoweb.org/) it is basically a suite of tools that will take data from a variety of datasources (including a MySql database), transformed that data to RDF, then load it into a triple store.

Finally, the VIVO software is actually built on top of something called Vitro (https://github.com/vivo-project/Vitro) , which is basically a copy of VIVO without the VIVO (and associated ontologies) built in.  Using Vitro you could load in your own ontology and then use the available ingest tools (or  the VIVO-Harvester) to load in your data.

-----Original Message-----
From: Vinicios Binsfeld [mailto:viniciosbinsfeld@gmail.com<ma...@gmail.com>]
Sent: Monday, September 01, 2014 8:06 AM
To: dev; users
Subject: SDB with MySQL and Java

Hello.

Someone has any examples of how popular one with OWL ontology data using SDB?

I'm using MySQL and SDB data. The connection with the database is working well. Now I need an example of how populate the ontology and how to manipulate, fetch data, update data, and create new records.



--



--
Atenciosamente,
Vinicios Adonis Binsfeld
E-mail  / Google Talk : viniciosbinsfeld@gmail.com<ma...@gmail.com>


Re: SDB with MySQL and Java

Posted by Vinicios Binsfeld <vi...@gmail.com>.
Hi John.

I will need to create some SWRL rules on the data present in the ontology,
then I need to use the native four tables of Jena SDB or could maybe use
D2RQ or VITRO to do the queries using SWRL?


2014-09-02 10:44 GMT-03:00 John A. Fereira <ja...@cornell.edu>:

> It's not clear to me what you're trying to do.
>
> Is the MySQL database you mention the database that sits behind the Jena
> SDB triple store.  That database would have four tables (nodes, prefixes,
> quads, triples) and wouldn't be a database that you would access directly
> using SQL queries.
>
> If, however, you're talking about a separate MySQL database that contains
> the data, in tabular format that you want map to your ontology you have
> several options.
>
> As Andy mentioned in an earlier thread the D2RQ project (
> http://d2rq.org/jena) can map tabular data in a database into RDF that
> can be loaded into a SDB.
>
> Another project that a lot of people are finding useful is Karma (
> http://isi.edu/integration/karma/)  I has a GUI which allows you to load
> in an ontology, then import data from a variety of formats (including
> establishing a MySQL database connection and executing SQL to grab data).
> Then it uses a nice UI which can map the data in each column to the
> appropriate classes and properties in your ontology.  Then once you're done
> it can "publish" your data to a Jena SDB instance.
>
> Another project, for which I recently became the maintainer is something
> called VIVO-Harvester (https://github.com/vivo-project/VIVO-Harvester).
> Although it's intended to be used with VIVO (a semantic web application:
> http://www.vivoweb.org/) it is basically a suite of tools that will take
> data from a variety of datasources (including a MySql database),
> transformed that data to RDF, then load it into a triple store.
>
> Finally, the VIVO software is actually built on top of something called
> Vitro (https://github.com/vivo-project/Vitro) , which is basically a copy
> of VIVO without the VIVO (and associated ontologies) built in.  Using Vitro
> you could load in your own ontology and then use the available ingest tools
> (or  the VIVO-Harvester) to load in your data.
>
> -----Original Message-----
> From: Vinicios Binsfeld [mailto:viniciosbinsfeld@gmail.com]
> Sent: Monday, September 01, 2014 8:06 AM
> To: dev; users
> Subject: SDB with MySQL and Java
>
> Hello.
>
> Someone has any examples of how popular one with OWL ontology data using
> SDB?
>
> I'm using MySQL and SDB data. The connection with the database is working
> well. Now I need an example of how populate the ontology and how to
> manipulate, fetch data, update data, and create new records.
>
>
>
> --
>



-- 
Atenciosamente,

Vinicios Adonis Binsfeld
*E-mail  / Google Talk : viniciosbinsfeld@gmail.com
<vi...@gmail.com>*

Re: SDB with MySQL and Java

Posted by Vinicios Binsfeld <vi...@gmail.com>.
Hi John.

I will need to create some SWRL rules on the data present in the ontology,
then I need to use the native four tables of Jena SDB or could maybe use
D2RQ or VITRO to do the queries using SWRL?


2014-09-02 10:44 GMT-03:00 John A. Fereira <ja...@cornell.edu>:

> It's not clear to me what you're trying to do.
>
> Is the MySQL database you mention the database that sits behind the Jena
> SDB triple store.  That database would have four tables (nodes, prefixes,
> quads, triples) and wouldn't be a database that you would access directly
> using SQL queries.
>
> If, however, you're talking about a separate MySQL database that contains
> the data, in tabular format that you want map to your ontology you have
> several options.
>
> As Andy mentioned in an earlier thread the D2RQ project (
> http://d2rq.org/jena) can map tabular data in a database into RDF that
> can be loaded into a SDB.
>
> Another project that a lot of people are finding useful is Karma (
> http://isi.edu/integration/karma/)  I has a GUI which allows you to load
> in an ontology, then import data from a variety of formats (including
> establishing a MySQL database connection and executing SQL to grab data).
> Then it uses a nice UI which can map the data in each column to the
> appropriate classes and properties in your ontology.  Then once you're done
> it can "publish" your data to a Jena SDB instance.
>
> Another project, for which I recently became the maintainer is something
> called VIVO-Harvester (https://github.com/vivo-project/VIVO-Harvester).
> Although it's intended to be used with VIVO (a semantic web application:
> http://www.vivoweb.org/) it is basically a suite of tools that will take
> data from a variety of datasources (including a MySql database),
> transformed that data to RDF, then load it into a triple store.
>
> Finally, the VIVO software is actually built on top of something called
> Vitro (https://github.com/vivo-project/Vitro) , which is basically a copy
> of VIVO without the VIVO (and associated ontologies) built in.  Using Vitro
> you could load in your own ontology and then use the available ingest tools
> (or  the VIVO-Harvester) to load in your data.
>
> -----Original Message-----
> From: Vinicios Binsfeld [mailto:viniciosbinsfeld@gmail.com]
> Sent: Monday, September 01, 2014 8:06 AM
> To: dev; users
> Subject: SDB with MySQL and Java
>
> Hello.
>
> Someone has any examples of how popular one with OWL ontology data using
> SDB?
>
> I'm using MySQL and SDB data. The connection with the database is working
> well. Now I need an example of how populate the ontology and how to
> manipulate, fetch data, update data, and create new records.
>
>
>
> --
>



-- 
Atenciosamente,

Vinicios Adonis Binsfeld
*E-mail  / Google Talk : viniciosbinsfeld@gmail.com
<vi...@gmail.com>*

RE: SDB with MySQL and Java

Posted by "John A. Fereira" <ja...@cornell.edu>.
It's not clear to me what you're trying to do.

Is the MySQL database you mention the database that sits behind the Jena SDB triple store.  That database would have four tables (nodes, prefixes, quads, triples) and wouldn't be a database that you would access directly using SQL queries.

If, however, you're talking about a separate MySQL database that contains the data, in tabular format that you want map to your ontology you have several options.

As Andy mentioned in an earlier thread the D2RQ project (http://d2rq.org/jena) can map tabular data in a database into RDF that can be loaded into a SDB.

Another project that a lot of people are finding useful is Karma (http://isi.edu/integration/karma/)  I has a GUI which allows you to load in an ontology, then import data from a variety of formats (including establishing a MySQL database connection and executing SQL to grab data).  Then it uses a nice UI which can map the data in each column to the appropriate classes and properties in your ontology.  Then once you're done it can "publish" your data to a Jena SDB instance.

Another project, for which I recently became the maintainer is something called VIVO-Harvester (https://github.com/vivo-project/VIVO-Harvester).  Although it's intended to be used with VIVO (a semantic web application: http://www.vivoweb.org/) it is basically a suite of tools that will take data from a variety of datasources (including a MySql database), transformed that data to RDF, then load it into a triple store.  

Finally, the VIVO software is actually built on top of something called Vitro (https://github.com/vivo-project/Vitro) , which is basically a copy of VIVO without the VIVO (and associated ontologies) built in.  Using Vitro you could load in your own ontology and then use the available ingest tools (or  the VIVO-Harvester) to load in your data.

-----Original Message-----
From: Vinicios Binsfeld [mailto:viniciosbinsfeld@gmail.com]  
Sent: Monday, September 01, 2014 8:06 AM
To: dev; users
Subject: SDB with MySQL and Java

Hello.

Someone has any examples of how popular one with OWL ontology data using SDB?

I'm using MySQL and SDB data. The connection with the database is working well. Now I need an example of how populate the ontology and how to manipulate, fetch data, update data, and create new records.



--

RE: SDB with MySQL and Java

Posted by "John A. Fereira" <ja...@cornell.edu>.
It's not clear to me what you're trying to do.

Is the MySQL database you mention the database that sits behind the Jena SDB triple store.  That database would have four tables (nodes, prefixes, quads, triples) and wouldn't be a database that you would access directly using SQL queries.

If, however, you're talking about a separate MySQL database that contains the data, in tabular format that you want map to your ontology you have several options.

As Andy mentioned in an earlier thread the D2RQ project (http://d2rq.org/jena) can map tabular data in a database into RDF that can be loaded into a SDB.

Another project that a lot of people are finding useful is Karma (http://isi.edu/integration/karma/)  I has a GUI which allows you to load in an ontology, then import data from a variety of formats (including establishing a MySQL database connection and executing SQL to grab data).  Then it uses a nice UI which can map the data in each column to the appropriate classes and properties in your ontology.  Then once you're done it can "publish" your data to a Jena SDB instance.

Another project, for which I recently became the maintainer is something called VIVO-Harvester (https://github.com/vivo-project/VIVO-Harvester).  Although it's intended to be used with VIVO (a semantic web application: http://www.vivoweb.org/) it is basically a suite of tools that will take data from a variety of datasources (including a MySql database), transformed that data to RDF, then load it into a triple store.  

Finally, the VIVO software is actually built on top of something called Vitro (https://github.com/vivo-project/Vitro) , which is basically a copy of VIVO without the VIVO (and associated ontologies) built in.  Using Vitro you could load in your own ontology and then use the available ingest tools (or  the VIVO-Harvester) to load in your data.

-----Original Message-----
From: Vinicios Binsfeld [mailto:viniciosbinsfeld@gmail.com]  
Sent: Monday, September 01, 2014 8:06 AM
To: dev; users
Subject: SDB with MySQL and Java

Hello.

Someone has any examples of how popular one with OWL ontology data using SDB?

I'm using MySQL and SDB data. The connection with the database is working well. Now I need an example of how populate the ontology and how to manipulate, fetch data, update data, and create new records.



--

Re: SDB with MySQL and Java

Posted by Andy Seaborne <an...@apache.org>.
On 01/09/14 16:55, Vinicios Binsfeld wrote:
> Hi Chris.
>
> I will put this part in a separate Server (Amazon EC2). That will
> comunicate  with the android aplication using REST.
>
> I thought about using SDB due to large amount of data.

TDB scales better.

>
> I did not understand the following: If I load the RDF into a model into and
> populate it, like I'm going to do to store it?

You need to "think web" - PUT/POST RDF to a remote SPARQL server.

Exposing JDBC endpoints on the web is not a good plan.

> In a second moment, where I already have the data in the model saved in the
> bank, how would you do to get them?

See Fuseki - a SPARQL server.

	Andy

>
>
>
>
> 2014-09-01 12:13 GMT-03:00 Chris Dollin <ch...@epimorphics.com>:
>
>> On Monday, September 01, 2014 11:41:20 AM Vinicios Binsfeld wrote:
>>
>>> I will use the ontology (https://code.google.com/p/
>> vital-sign-ontologia /
>>> <https://code.google.com/p/vital-sign-ontology/> ) for this propouse:
>> I'll
>>> have a Android application which will capture vital signs, then I will
>> have
>>> to store this data in a database MySql
>>
>> On the Android machine, or on some separate server?
>>
>> Must it be SDB/MySQL or would TDB be acceptable?
>>
>>> For this I chose to use the SDB with MySql, but I could not find any
>>> material that shows how to load it with popular ontology and data.
>>
>> You have a Jena model. You can load any RDF into it you like, using the
>> Model API that Jena supplies, just as you would for a memory-based
>> model or TDB or any other adaptor. You can write code that creates
>> resources and properties and statements and puts them in the model.
>> If you need to -- and you may not -- you can load the ontology into
>> the model as well [1].
>>
>> Chris
>>
>> [1] Actually you'd load the ontology into a different sub-model of a
>>      Jena OntModel.
>>
>> --
>> "A facility for quotation covers the absence of original thought."/Gaudy
>> Night/
>>
>> Epimorphics Ltd, http://www.epimorphics.com
>> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
>> 6PT
>> Epimorphics Ltd. is a limited company registered in England (number
>> 7016688)
>>
>>
>
>


Re: Re: SDB with MySQL and Java

Posted by Vinicios Binsfeld <vi...@gmail.com>.
Hi Chris.

I will put this part in a separate Server (Amazon EC2). That will
comunicate  with the android aplication using REST.

I thought about using SDB due to large amount of data.

I did not understand the following: If I load the RDF into a model into and
populate it, like I'm going to do to store it?

In a second moment, where I already have the data in the model saved in the
bank, how would you do to get them?




2014-09-01 12:13 GMT-03:00 Chris Dollin <ch...@epimorphics.com>:

> On Monday, September 01, 2014 11:41:20 AM Vinicios Binsfeld wrote:
>
> > I will use the ontology (https://code.google.com/p/
> vital-sign-ontologia /
> > <https://code.google.com/p/vital-sign-ontology/> ) for this propouse:
> I'll
> > have a Android application which will capture vital signs, then I will
> have
> > to store this data in a database MySql
>
> On the Android machine, or on some separate server?
>
> Must it be SDB/MySQL or would TDB be acceptable?
>
> > For this I chose to use the SDB with MySql, but I could not find any
> > material that shows how to load it with popular ontology and data.
>
> You have a Jena model. You can load any RDF into it you like, using the
> Model API that Jena supplies, just as you would for a memory-based
> model or TDB or any other adaptor. You can write code that creates
> resources and properties and statements and puts them in the model.
> If you need to -- and you may not -- you can load the ontology into
> the model as well [1].
>
> Chris
>
> [1] Actually you'd load the ontology into a different sub-model of a
>     Jena OntModel.
>
> --
> "A facility for quotation covers the absence of original thought."/Gaudy
> Night/
>
> Epimorphics Ltd, http://www.epimorphics.com
> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
> 6PT
> Epimorphics Ltd. is a limited company registered in England (number
> 7016688)
>
>


-- 
Atenciosamente,

Vinicios Adonis Binsfeld
*E-mail  / Google Talk : viniciosbinsfeld@gmail.com
<vi...@gmail.com>*
*Skype: **vinicios.binsfeld <http://vinicios.binsfeld>    |
**facebook.com/viniciosb
<http://facebook.com/viniciosb>*

Re: Re: SDB with MySQL and Java

Posted by Chris Dollin <ch...@epimorphics.com>.
On Monday, September 01, 2014 11:41:20 AM Vinicios Binsfeld wrote:

> I will use the ontology (https://code.google.com/p/ vital-sign-ontologia /
> <https://code.google.com/p/vital-sign-ontology/> ) for this propouse: I'll
> have a Android application which will capture vital signs, then I will have
> to store this data in a database MySql 

On the Android machine, or on some separate server?

Must it be SDB/MySQL or would TDB be acceptable? 
 
> For this I chose to use the SDB with MySql, but I could not find any
> material that shows how to load it with popular ontology and data.

You have a Jena model. You can load any RDF into it you like, using the
Model API that Jena supplies, just as you would for a memory-based
model or TDB or any other adaptor. You can write code that creates
resources and properties and statements and puts them in the model.
If you need to -- and you may not -- you can load the ontology into
the model as well [1].

Chris

[1] Actually you'd load the ontology into a different sub-model of a
    Jena OntModel.

-- 
"A facility for quotation covers the absence of original thought."/Gaudy Night/

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)


Re: SDB with MySQL and Java

Posted by Vinicios Binsfeld <vi...@gmail.com>.
Hi.

I will use the ontology (https://code.google.com/p/ vital-sign-ontologia /
<https://code.google.com/p/vital-sign-ontology/> ) for this propouse: I'll
have a Android application which will capture vital signs, then I will have
to store this data in a database MySql and will use the ontology to perform
inferences and create rules that serve to create alerts based on data
stored in my ontology and database.

For this I chose to use the SDB with MySql, but I could not find any
material that shows how to load it with popular ontology and data.


2014-09-01 11:36 GMT-03:00 Andy Seaborne <an...@apache.org>:

> On 01/09/14 13:46, Vinicios Binsfeld wrote:
>
>> Hi Cris.
>>
>>
>> I believe I still do not have the Model.
>>
>
> This is what Chris is referring to:
>
> >   Model model = SDBFactory.connectDefaultModel(store) ;
>
> You can add triples to that.
>
>
>  The ontology that a will use is:
>> https://code.google.com/p/vital-sign-ontology/
>>
>
> See
>
> http://mail-archives.apache.org/mod_mbox/jena-users/
> 201408.mbox/%3C53FF0959.6020802%40apache.org%3E
>
> for working with an existing (non-RDF) DB schema.
>
> Do you have an existing data in a MySQL database or do you wish to create
> a new RDF database with your own data?
>
>         Andy
>
>
>
>> Sorry for the basic questions. I am starting now to work with ontologies.
>> The code I have now is this:
>>
>>
>>
>>                  final String className = "com.mysql.jdbc.Driver";
>>   final String DB_URL = "jdbc:mysql://localhost:3306/rdfplay";
>> final String DB_USER = "root";
>>   final String DB_PASSWD = "admin";
>>
>>      StoreDesc storeDesc = new StoreDesc(LayoutType.
>> LayoutTripleNodesHash,
>> DatabaseType.MySQL) ;
>>
>> JDBC.loadDriverMySQL();
>>   //String jdbcURL = "jdbc:derby:DB/SDB2";
>> SDBConnection conn = new SDBConnection(DB_URL, DB_USER, DB_PASSWD) ;
>>   Store store = SDBFactory.connectStore(conn, storeDesc) ;
>> store.getTableFormatter().create();
>>    Dataset ds = SDBFactory.connectDataset(store) ;
>>
>>
>>   Model model = SDBFactory.connectDefaultModel(store) ;
>>
>>
>> 2014-09-01 9:37 GMT-03:00 Chris Dollin <ch...@epimorphics.com>:
>>
>>  On Monday, September 01, 2014 09:06:10 AM Vinicios Binsfeld wrote:
>>>
>>>  Someone has any examples of how popular one with OWL ontology data using
>>>> SDB?
>>>>
>>>> I'm using MySQL and SDB data. The connection with the database is
>>>> working
>>>> well. Now I need an example of how populate the ontology and how to
>>>> manipulate, fetch data, update data, and create new records.
>>>>
>>>
>>> You've got an SDB model, yes?
>>>
>>> It's a Jena model. Use the Model and Resource and Literal APIs.
>>>
>>> Chris
>>>
>>> (who wonders if he's missing something)
>>>
>>> --
>>> "The process will be long and ... unreliable."                 Box, /Star
>>> Cops/
>>>
>>> Epimorphics Ltd, http://www.epimorphics.com
>>> Registered address: Court Lodge, 105 High Street, Portishead, Bristol
>>> BS20
>>> 6PT
>>> Epimorphics Ltd. is a limited company registered in England (number
>>> 7016688)
>>>
>>>
>>>
>>
>>
>


-- 
Atenciosamente,

Vinicios Adonis Binsfeld
*E-mail  / Google Talk : viniciosbinsfeld@gmail.com
<vi...@gmail.com>*
*Skype: **vinicios.binsfeld <http://vinicios.binsfeld>    |
**facebook.com/viniciosb
<http://facebook.com/viniciosb>*

Re: SDB with MySQL and Java

Posted by Andy Seaborne <an...@apache.org>.
On 01/09/14 13:46, Vinicios Binsfeld wrote:
> Hi Cris.
>
>
> I believe I still do not have the Model.

This is what Chris is referring to:

 >   Model model = SDBFactory.connectDefaultModel(store) ;

You can add triples to that.

> The ontology that a will use is:
> https://code.google.com/p/vital-sign-ontology/

See

http://mail-archives.apache.org/mod_mbox/jena-users/201408.mbox/%3C53FF0959.6020802%40apache.org%3E 


for working with an existing (non-RDF) DB schema.

Do you have an existing data in a MySQL database or do you wish to 
create a new RDF database with your own data?

	Andy

>
> Sorry for the basic questions. I am starting now to work with ontologies.
> The code I have now is this:
>
>
>
>                  final String className = "com.mysql.jdbc.Driver";
>   final String DB_URL = "jdbc:mysql://localhost:3306/rdfplay";
> final String DB_USER = "root";
>   final String DB_PASSWD = "admin";
>
>      StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash,
> DatabaseType.MySQL) ;
>
> JDBC.loadDriverMySQL();
>   //String jdbcURL = "jdbc:derby:DB/SDB2";
> SDBConnection conn = new SDBConnection(DB_URL, DB_USER, DB_PASSWD) ;
>   Store store = SDBFactory.connectStore(conn, storeDesc) ;
> store.getTableFormatter().create();
>    Dataset ds = SDBFactory.connectDataset(store) ;
>
>
>   Model model = SDBFactory.connectDefaultModel(store) ;
>
>
> 2014-09-01 9:37 GMT-03:00 Chris Dollin <ch...@epimorphics.com>:
>
>> On Monday, September 01, 2014 09:06:10 AM Vinicios Binsfeld wrote:
>>
>>> Someone has any examples of how popular one with OWL ontology data using
>>> SDB?
>>>
>>> I'm using MySQL and SDB data. The connection with the database is working
>>> well. Now I need an example of how populate the ontology and how to
>>> manipulate, fetch data, update data, and create new records.
>>
>> You've got an SDB model, yes?
>>
>> It's a Jena model. Use the Model and Resource and Literal APIs.
>>
>> Chris
>>
>> (who wonders if he's missing something)
>>
>> --
>> "The process will be long and ... unreliable."                 Box, /Star
>> Cops/
>>
>> Epimorphics Ltd, http://www.epimorphics.com
>> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
>> 6PT
>> Epimorphics Ltd. is a limited company registered in England (number
>> 7016688)
>>
>>
>
>


Re: SDB with MySQL and Java

Posted by Vinicios Binsfeld <vi...@gmail.com>.
Hi Cris.


I believe I still do not have the Model. The ontology that a will use is:
https://code.google.com/p/vital-sign-ontology/

Sorry for the basic questions. I am starting now to work with ontologies.
The code I have now is this:



                final String className = "com.mysql.jdbc.Driver";
 final String DB_URL = "jdbc:mysql://localhost:3306/rdfplay";
final String DB_USER = "root";
 final String DB_PASSWD = "admin";

    StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash,
DatabaseType.MySQL) ;

JDBC.loadDriverMySQL();
 //String jdbcURL = "jdbc:derby:DB/SDB2";
SDBConnection conn = new SDBConnection(DB_URL, DB_USER, DB_PASSWD) ;
 Store store = SDBFactory.connectStore(conn, storeDesc) ;
store.getTableFormatter().create();
  Dataset ds = SDBFactory.connectDataset(store) ;


 Model model = SDBFactory.connectDefaultModel(store) ;


2014-09-01 9:37 GMT-03:00 Chris Dollin <ch...@epimorphics.com>:

> On Monday, September 01, 2014 09:06:10 AM Vinicios Binsfeld wrote:
>
> > Someone has any examples of how popular one with OWL ontology data using
> > SDB?
> >
> > I'm using MySQL and SDB data. The connection with the database is working
> > well. Now I need an example of how populate the ontology and how to
> > manipulate, fetch data, update data, and create new records.
>
> You've got an SDB model, yes?
>
> It's a Jena model. Use the Model and Resource and Literal APIs.
>
> Chris
>
> (who wonders if he's missing something)
>
> --
> "The process will be long and ... unreliable."                 Box, /Star
> Cops/
>
> Epimorphics Ltd, http://www.epimorphics.com
> Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20
> 6PT
> Epimorphics Ltd. is a limited company registered in England (number
> 7016688)
>
>


-- 
Atenciosamente,

Vinicios Adonis Binsfeld
*E-mail  / Google Talk : viniciosbinsfeld@gmail.com
<vi...@gmail.com>*
*Skype: **vinicios.binsfeld <http://vinicios.binsfeld>    |
**facebook.com/viniciosb
<http://facebook.com/viniciosb>*

Re: SDB with MySQL and Java

Posted by Chris Dollin <ch...@epimorphics.com>.
On Monday, September 01, 2014 09:06:10 AM Vinicios Binsfeld wrote:

> Someone has any examples of how popular one with OWL ontology data using
> SDB?
> 
> I'm using MySQL and SDB data. The connection with the database is working
> well. Now I need an example of how populate the ontology and how to
> manipulate, fetch data, update data, and create new records.

You've got an SDB model, yes?

It's a Jena model. Use the Model and Resource and Literal APIs.

Chris

(who wonders if he's missing something)

-- 
"The process will be long and ... unreliable."                 Box, /Star Cops/

Epimorphics Ltd, http://www.epimorphics.com
Registered address: Court Lodge, 105 High Street, Portishead, Bristol BS20 6PT
Epimorphics Ltd. is a limited company registered in England (number 7016688)