You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Márcio Vinicius <ma...@gmail.com> on 2013/09/03 20:35:05 UTC

SDB to TDB

Dear, I have studied the Jena for some time and did some test prototypes.
In recent studies found that the documentation indicates the TDB component
for development of new applications, but all prototypes that had made was
based on SDB.

Example of connection:

      public Store getStore() {

StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash,
 DatabaseType.PostgreSQL);
JDBC.loadDriverPGSQL();

SDBConnection conn = new SDBConnection(Constants.DB_URL,
 Constants.DB_USER,
Constants.DB_PASSWD);

Store store = SDBFactory.connectStore(conn, storeDesc);
 try {
if (!StoreUtils.isFormatted(store)) {
store.getTableFormatter().create();
 }
} catch (SQLException e) {
e.printStackTrace();
 }
return store;
}

How do I use the component TDB?

att

-- 
*Márcio Vinícius Oliveira Sena*
Bacharelando em Sistemas de Informação -  UFG
Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias Educacionais
- Labtime/UFG
Gerente de Projeto e Desenvolvedor Front-end
@marciosena17 <http://twitter.com/marciosena17>

Re: SDB to TDB

Posted by Andy Seaborne <an...@apache.org>.
On 23/09/13 18:39, Márcio Vinicius wrote:
> Hello, I'm beginning to study and develop a small prototype of a future
> application. I'm already using TDB and could store and retrieve triple.
> However I have some questions:
>
> - It would be possible to retrieve the information and put them in a model?

Yes.

>
> Currently I do the following storage and data recovery:
>
>
> public class DataBase {
>
>    public void store(Model model) {
>
>          Dataset dataset = TDBFactory.createDataset(Constants.DIRECTORY);
>          Model tdb = dataset.getDefaultModel();
>          tdb.add(model);
>          tdb.close();
>          dataset.close();
>    }

Thats' OK - another way to do it is to get the model from the dataset 
andwriet directly into 'tdb'.

Trasnactions are better as you use them later - but if you are not using 
them, consider havign the dataset created once and using TDB.sync(dataset).


>    public String query(String sparqlQueryString) {
>          Dataset dataset = TDBFactory.createDataset(Constants.DIRECTORY);
>          String msg = "";
>          try {
>                  dataset.begin(ReadWrite.READ);
>                  dataset.getNamedModel(Constants.NAME_APPLICATION);
>                  Query query = QueryFactory.create(sparqlQueryString);
>
>                  QueryExecution qexec = QueryExecutionFactory.create(query,
> dataset);
>
>                  ResultSet results = qexec.execSelect();
>
>                  ResultSetFormatter.out(results);
>
>           } catch (Exception e) {
>
>                  e.printStackTrace();
>
>                  msg = "erro";
>
>           } finally {
>
>                  dataset.end();
>
>                  dataset.close();

No need to close, in fact repeated opening and closing is just a small 
amount of overhead.  The system caches the real connection to the DB.

	Andy

>
>           }
>
>          return msg;
>     }
> }
>
>
> Sincerely.


Re: SDB to TDB

Posted by Márcio Vinicius <ma...@gmail.com>.
Hello, I'm beginning to study and develop a small prototype of a future
application. I'm already using TDB and could store and retrieve triple.
However I have some questions:

- It would be possible to retrieve the information and put them in a model?

Currently I do the following storage and data recovery:


public class DataBase {

  public void store(Model model) {

        Dataset dataset = TDBFactory.createDataset(Constants.DIRECTORY);
        Model tdb = dataset.getDefaultModel();
        tdb.add(model);
        tdb.close();
        dataset.close();
  }


  public String query(String sparqlQueryString) {
        Dataset dataset = TDBFactory.createDataset(Constants.DIRECTORY);
        String msg = "";
        try {
                dataset.begin(ReadWrite.READ);
                dataset.getNamedModel(Constants.NAME_APPLICATION);
                Query query = QueryFactory.create(sparqlQueryString);

                QueryExecution qexec = QueryExecutionFactory.create(query,
dataset);

                ResultSet results = qexec.execSelect();

                ResultSetFormatter.out(results);

         } catch (Exception e) {

                e.printStackTrace();

                msg = "erro";

         } finally {

                dataset.end();

                dataset.close();

         }

        return msg;
   }
}


Sincerely.


2013/9/16 Andy Seaborne <an...@apache.org>

> On 16/09/13 15:21, Márcio Vinicius wrote:
>
>> Andy, in relation to TDB have some application client to manage the files
>> for storing triples, such as phpMyAdmin or pgAdmin.
>>
>
> There's nothing of that kind in Jena itself - it would be nice for Fuseki
>
> See JENA-420.
>
>  Cause I'm developing a large application and I think I need some
>> application that assist me file management has persisted.
>>
>> thank you.
>>
>>
>> 2013/9/16 Márcio Vinicius <ma...@gmail.com>
>>
>>  Andy, you cleared my doubts. I am developing an application that requires
>>> a relational database (Postgres), because I register more than 60,000
>>> objects, as well as users and etc..
>>>
>>> Logo must use SDB. Thank you.
>>>
>>>
>>> 2013/9/15 Andy Seaborne <an...@apache.org>
>>>
>>>  On 13/09/13 21:18, Márcio Vinicius wrote:
>>>>
>>>>  Andy,
>>>>>
>>>>>            In Jena documentation, all the examples using the TDB does
>>>>> not
>>>>> use
>>>>> a relational database (MySQL or Postgres), is to use a bank or
>>>>> component
>>>>> is
>>>>> only TDB file?
>>>>>
>>>>>
>>>> (sorry - I don't understand the last part of that sentence)
>>>>
>>>>
>>>>
>>>>              It is recommended to use SDB on new projects? Because I
>>>>> read
>>>>> that
>>>>> it was not recommended.
>>>>>
>>>>>
>>>> We do not recommend using SDB for new projects.  See [1]. There are
>>>> cases
>>>> where SDB is necessary, typically where storing in an SQL databases is a
>>>> mandatory requirement of a project.  However, SDB does not scale as
>>>> well as
>>>> TDB and is slower.  It does not get the same level of testing as other
>>>> components - the project relies on user reports and we do not have
>>>> complete
>>>> coverage any more.
>>>>
>>>>          Andy
>>>>
>>>> [1] The wording we use visible at:
>>>>    http://jena.staging.apache.****org/documentation/sdb/<http://**
>>>> jena.staging.apache.org/**documentation/sdb/<http://jena.staging.apache.org/documentation/sdb/>
>>>> >
>>>>
>>>> and will be published to the main site in the next release.
>>>>
>>>>
>>>>  thank.
>>>>>
>>>>>
>>>>> 2013/9/3 Andy Seaborne <an...@apache.org>
>>>>>
>>>>>   On 03/09/13 19:35, Márcio Vinicius wrote:
>>>>>
>>>>>>
>>>>>>   Dear, I have studied the Jena for some time and did some test
>>>>>>
>>>>>>> prototypes.
>>>>>>> In recent studies found that the documentation indicates the TDB
>>>>>>> component
>>>>>>> for development of new applications, but all prototypes that had made
>>>>>>> was
>>>>>>> based on SDB.
>>>>>>>
>>>>>>> Example of connection:
>>>>>>>
>>>>>>>          public Store getStore() {
>>>>>>>
>>>>>>> StoreDesc storeDesc = new StoreDesc(LayoutType.****
>>>>>>> LayoutTripleNodesHash,
>>>>>>>     DatabaseType.PostgreSQL);
>>>>>>> JDBC.loadDriverPGSQL();
>>>>>>>
>>>>>>> SDBConnection conn = new SDBConnection(Constants.DB_******URL,
>>>>>>>
>>>>>>>
>>>>>>>     Constants.DB_USER,
>>>>>>> Constants.DB_PASSWD);
>>>>>>>
>>>>>>> Store store = SDBFactory.connectStore(conn, storeDesc);
>>>>>>>     try {
>>>>>>> if (!StoreUtils.isFormatted(******store)) {
>>>>>>> store.getTableFormatter().******create();
>>>>>>>
>>>>>>>
>>>>>>>     }
>>>>>>> } catch (SQLException e) {
>>>>>>> e.printStackTrace();
>>>>>>>     }
>>>>>>> return store;
>>>>>>> }
>>>>>>>
>>>>>>> How do I use the component TDB?
>>>>>>>
>>>>>>>
>>>>>>>  Hi there,
>>>>>>
>>>>>> See
>>>>>>
>>>>>> http://jena.apache.org/******documentation/tdb/<http://jena.apache.org/****documentation/tdb/>
>>>>>> <http://**jena.apache.org/****documentation/tdb/<http://jena.apache.org/**documentation/tdb/>
>>>>>> >
>>>>>> <http://**jena.apache.org/**documentation/**tdb/<http://jena.apache.org/documentation/**tdb/>
>>>>>> <http://**jena.apache.org/documentation/**tdb/<http://jena.apache.org/documentation/tdb/>
>>>>>> >
>>>>>>
>>>>>>>
>>>>>>>
>>>>>> The pattern is similar:
>>>>>>
>>>>>> Dataset ds = TDBFactory.createDatatset(******directory) ;
>>>>>>
>>>>>>
>>>>>>
>>>>>> and use the dataset as normal.
>>>>>>
>>>>>> No formatting is necessary.
>>>>>>
>>>>>>           Andy
>>>>>>
>>>>>>
>>>>>>   att
>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>> --
>>> *Márcio Vinícius Oliveira Sena*
>>>
>>> Bacharelando em Sistemas de Informação -  UFG
>>> Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias
>>> Educacionais
>>> - Labtime/UFG
>>> Gerente de Projeto e Desenvolvedor Front-end
>>> @marciosena17 <http://twitter.com/**marciosena17<http://twitter.com/marciosena17>
>>> >
>>>
>>>
>>>
>>
>>
>


-- 
*Márcio Vinícius Oliveira Sena*
Bacharelando em Sistemas de Informação -  UFG
Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias Educacionais
- Labtime/UFG
Gerente de Projeto e Desenvolvedor Front-end
@marciosena17 <http://twitter.com/marciosena17>

RE: blank node question

Posted by Mona Salem <mo...@gmail.com>.
Thanks Ian.  Really kind of you to take the time to illustrate this.  Mona

-----Original Message-----
From: Ian Dickinson [mailto:i.j.dickinson@gmail.com] 
Sent: Monday, September 16, 2013 3:49 PM
To: users@jena.apache.org
Subject: Re: blank node question

Hi Mona,

On Mon, Sep 16, 2013 at 10:15 PM, Mona Salem <mo...@gmail.com> wrote:
> Resource johnSmith
>   = model.createResource(personURI
>          .addProperty(VCARD.FN, fullName)
>          .addProperty(VCARD.N,
>                       model.createResource()
>                            .addProperty(VCARD.Given, bNode0)
>                            .addProperty(VCARD.Family, bNode1));
>
>
> Regarding the VCARD.N: does the N need to be defined somewhere?
Yes. Jena has a few built-in vocabulary classes, and (a rather old) version
of vcard is one of them. See:

http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/vocabulary
/VCARD.html

There's no particular reason why vcard is a built-in vocabulary (unlike,
say, RDF and RDFS which are very helpful to application writers). I suspect
it was initially added to Jena to make it easier to write the tutorials!

vcard:N is an RDF property denoting the name of a thing. See the definition
here:

http://www.w3.org/TR/vcard-rdf/#Identification_Properties

so the code:

     .addProperty(VCARD.N, <thing> )

is adding a triple with the given subject resource, predicate vcard:N and
object a blank node resource created by the createResource() call.

I think that, as a tutorial, this code isn't as clear as it could be.
Rewriting it step-by-step, what's really happening is this:

    Resource bNode3 = model.createResource();

    bNode3.addProperty(VCARD.Given, bNode0);
    bNode3.addProperty(VCARD.Family, bNode1));

    Resource johnSmith = model.createResource( personURI );

    johnSmith.addProperty(VCARD.FN, fullName);
    johnSmith.addProperty(VCARD.N, bNode3 );

As originally written, it's perhaps more idiomatic Java, but it's also
harder for beginners to understand. Anyway, I hope it's clearer now.

> Is this the correct way to ask questions, by sending to the users 
> email address?
Yes. Welcome to jena-users!  You don't need to quote an old question, unless
your comment is a response to that previous thread.

Ian


Re: blank node question

Posted by Ian Dickinson <i....@gmail.com>.
Hi Mona,

On Mon, Sep 16, 2013 at 10:15 PM, Mona Salem <mo...@gmail.com> wrote:
> Resource johnSmith
>   = model.createResource(personURI
>          .addProperty(VCARD.FN, fullName)
>          .addProperty(VCARD.N,
>                       model.createResource()
>                            .addProperty(VCARD.Given, bNode0)
>                            .addProperty(VCARD.Family, bNode1));
>
>
> Regarding the VCARD.N: does the N need to be defined somewhere?
Yes. Jena has a few built-in vocabulary classes, and (a rather old)
version of vcard is one of them. See:

http://jena.apache.org/documentation/javadoc/jena/com/hp/hpl/jena/vocabulary/VCARD.html

There's no particular reason why vcard is a built-in vocabulary
(unlike, say, RDF and RDFS which are very helpful to application
writers). I suspect it was initially added to Jena to make it easier
to write the tutorials!

vcard:N is an RDF property denoting the name of a thing. See the
definition here:

http://www.w3.org/TR/vcard-rdf/#Identification_Properties

so the code:

     .addProperty(VCARD.N, <thing> )

is adding a triple with the given subject resource, predicate vcard:N
and object a blank node resource created by the createResource() call.

I think that, as a tutorial, this code isn't as clear as it could be.
Rewriting it step-by-step, what's really happening is this:

    Resource bNode3 = model.createResource();

    bNode3.addProperty(VCARD.Given, bNode0);
    bNode3.addProperty(VCARD.Family, bNode1));

    Resource johnSmith = model.createResource( personURI );

    johnSmith.addProperty(VCARD.FN, fullName);
    johnSmith.addProperty(VCARD.N, bNode3 );

As originally written, it's perhaps more idiomatic Java, but it's also
harder for beginners to understand. Anyway, I hope it's clearer now.

> Is this the correct way to ask questions, by sending to the users email
> address?
Yes. Welcome to jena-users!  You don't need to quote an old question,
unless your comment is a response to that previous thread.

Ian

blank node question

Posted by Mona Salem <mo...@gmail.com>.
Resource johnSmith
  = model.createResource(personURI
         .addProperty(VCARD.FN, fullName)
         .addProperty(VCARD.N,
                      model.createResource()
                           .addProperty(VCARD.Given, bNode0)
                           .addProperty(VCARD.Family, bNode1));


Regarding the VCARD.N: does the N need to be defined somewhere?  (in the
vCard ontology?)  Is it a property (predicate) or just there to create the
blank node?

Is this the correct way to ask questions, by sending to the users email
address?
Thanks
Mona

-----Original Message-----
From: Andy Seaborne [mailto:andy@apache.org] 
Sent: Monday, September 16, 2013 2:02 PM
To: users@jena.apache.org
Subject: Re: SDB to TDB

On 16/09/13 15:21, Márcio Vinicius wrote:
> Andy, in relation to TDB have some application client to manage the 
> files for storing triples, such as phpMyAdmin or pgAdmin.

There's nothing of that kind in Jena itself - it would be nice for Fuseki

See JENA-420.

> Cause I'm developing a large application and I think I need some 
> application that assist me file management has persisted.
>
> thank you.
>
>
> 2013/9/16 Márcio Vinicius <ma...@gmail.com>
>
>> Andy, you cleared my doubts. I am developing an application that 
>> requires a relational database (Postgres), because I register more 
>> than 60,000 objects, as well as users and etc..
>>
>> Logo must use SDB. Thank you.
>>
>>
>> 2013/9/15 Andy Seaborne <an...@apache.org>
>>
>>> On 13/09/13 21:18, Márcio Vinicius wrote:
>>>
>>>> Andy,
>>>>
>>>>            In Jena documentation, all the examples using the TDB 
>>>> does not use a relational database (MySQL or Postgres), is to use a 
>>>> bank or component is only TDB file?
>>>>
>>>
>>> (sorry - I don't understand the last part of that sentence)
>>>
>>>
>>>
>>>>             It is recommended to use SDB on new projects? Because I 
>>>> read that it was not recommended.
>>>>
>>>
>>> We do not recommend using SDB for new projects.  See [1]. There are
cases
>>> where SDB is necessary, typically where storing in an SQL databases is a
>>> mandatory requirement of a project.  However, SDB does not scale as well
as
>>> TDB and is slower.  It does not get the same level of testing as other
>>> components - the project relies on user reports and we do not have
complete
>>> coverage any more.
>>>
>>>          Andy
>>>
>>> [1] The wording we use visible at:
>>>
http://jena.staging.apache.**org/documentation/sdb/<http://jena.staging.apac
he.org/documentation/sdb/>
>>> and will be published to the main site in the next release.
>>>
>>>
>>>> thank.
>>>>
>>>>
>>>> 2013/9/3 Andy Seaborne <an...@apache.org>
>>>>
>>>>   On 03/09/13 19:35, Márcio Vinicius wrote:
>>>>>
>>>>>   Dear, I have studied the Jena for some time and did some test
>>>>>> prototypes.
>>>>>> In recent studies found that the documentation indicates the TDB
>>>>>> component
>>>>>> for development of new applications, but all prototypes that had made
>>>>>> was
>>>>>> based on SDB.
>>>>>>
>>>>>> Example of connection:
>>>>>>
>>>>>>          public Store getStore() {
>>>>>>
>>>>>> StoreDesc storeDesc = new StoreDesc(LayoutType.****
>>>>>> LayoutTripleNodesHash,
>>>>>>     DatabaseType.PostgreSQL);
>>>>>> JDBC.loadDriverPGSQL();
>>>>>>
>>>>>> SDBConnection conn = new SDBConnection(Constants.DB_****URL,
>>>>>>
>>>>>>     Constants.DB_USER,
>>>>>> Constants.DB_PASSWD);
>>>>>>
>>>>>> Store store = SDBFactory.connectStore(conn, storeDesc);
>>>>>>     try {
>>>>>> if (!StoreUtils.isFormatted(****store)) {
>>>>>> store.getTableFormatter().****create();
>>>>>>
>>>>>>     }
>>>>>> } catch (SQLException e) {
>>>>>> e.printStackTrace();
>>>>>>     }
>>>>>> return store;
>>>>>> }
>>>>>>
>>>>>> How do I use the component TDB?
>>>>>>
>>>>>>
>>>>> Hi there,
>>>>>
>>>>> See
>>>>>
>>>>>
http://jena.apache.org/****documentation/tdb/<http://jena.apache.org/**docum
entation/tdb/>
>>>>>
<http://**jena.apache.org/documentation/**tdb/<http://jena.apache.org/docume
ntation/tdb/>
>>>>>>
>>>>>
>>>>> The pattern is similar:
>>>>>
>>>>> Dataset ds = TDBFactory.createDatatset(****directory) ;
>>>>>
>>>>>
>>>>> and use the dataset as normal.
>>>>>
>>>>> No formatting is necessary.
>>>>>
>>>>>           Andy
>>>>>
>>>>>
>>>>>   att
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> *Márcio Vinícius Oliveira Sena*
>> Bacharelando em Sistemas de Informação -  UFG
>> Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias
Educacionais
>> - Labtime/UFG
>> Gerente de Projeto e Desenvolvedor Front-end
>> @marciosena17 <http://twitter.com/marciosena17>
>>
>>
>
>


Re: SDB to TDB

Posted by Andy Seaborne <an...@apache.org>.
On 16/09/13 15:21, Márcio Vinicius wrote:
> Andy, in relation to TDB have some application client to manage the files
> for storing triples, such as phpMyAdmin or pgAdmin.

There's nothing of that kind in Jena itself - it would be nice for Fuseki

See JENA-420.

> Cause I'm developing a large application and I think I need some
> application that assist me file management has persisted.
>
> thank you.
>
>
> 2013/9/16 Márcio Vinicius <ma...@gmail.com>
>
>> Andy, you cleared my doubts. I am developing an application that requires
>> a relational database (Postgres), because I register more than 60,000
>> objects, as well as users and etc..
>>
>> Logo must use SDB. Thank you.
>>
>>
>> 2013/9/15 Andy Seaborne <an...@apache.org>
>>
>>> On 13/09/13 21:18, Márcio Vinicius wrote:
>>>
>>>> Andy,
>>>>
>>>>            In Jena documentation, all the examples using the TDB does not
>>>> use
>>>> a relational database (MySQL or Postgres), is to use a bank or component
>>>> is
>>>> only TDB file?
>>>>
>>>
>>> (sorry - I don't understand the last part of that sentence)
>>>
>>>
>>>
>>>>             It is recommended to use SDB on new projects? Because I read
>>>> that
>>>> it was not recommended.
>>>>
>>>
>>> We do not recommend using SDB for new projects.  See [1]. There are cases
>>> where SDB is necessary, typically where storing in an SQL databases is a
>>> mandatory requirement of a project.  However, SDB does not scale as well as
>>> TDB and is slower.  It does not get the same level of testing as other
>>> components - the project relies on user reports and we do not have complete
>>> coverage any more.
>>>
>>>          Andy
>>>
>>> [1] The wording we use visible at:
>>>    http://jena.staging.apache.**org/documentation/sdb/<http://jena.staging.apache.org/documentation/sdb/>
>>> and will be published to the main site in the next release.
>>>
>>>
>>>> thank.
>>>>
>>>>
>>>> 2013/9/3 Andy Seaborne <an...@apache.org>
>>>>
>>>>   On 03/09/13 19:35, Márcio Vinicius wrote:
>>>>>
>>>>>   Dear, I have studied the Jena for some time and did some test
>>>>>> prototypes.
>>>>>> In recent studies found that the documentation indicates the TDB
>>>>>> component
>>>>>> for development of new applications, but all prototypes that had made
>>>>>> was
>>>>>> based on SDB.
>>>>>>
>>>>>> Example of connection:
>>>>>>
>>>>>>          public Store getStore() {
>>>>>>
>>>>>> StoreDesc storeDesc = new StoreDesc(LayoutType.****
>>>>>> LayoutTripleNodesHash,
>>>>>>     DatabaseType.PostgreSQL);
>>>>>> JDBC.loadDriverPGSQL();
>>>>>>
>>>>>> SDBConnection conn = new SDBConnection(Constants.DB_****URL,
>>>>>>
>>>>>>     Constants.DB_USER,
>>>>>> Constants.DB_PASSWD);
>>>>>>
>>>>>> Store store = SDBFactory.connectStore(conn, storeDesc);
>>>>>>     try {
>>>>>> if (!StoreUtils.isFormatted(****store)) {
>>>>>> store.getTableFormatter().****create();
>>>>>>
>>>>>>     }
>>>>>> } catch (SQLException e) {
>>>>>> e.printStackTrace();
>>>>>>     }
>>>>>> return store;
>>>>>> }
>>>>>>
>>>>>> How do I use the component TDB?
>>>>>>
>>>>>>
>>>>> Hi there,
>>>>>
>>>>> See
>>>>>
>>>>> http://jena.apache.org/****documentation/tdb/<http://jena.apache.org/**documentation/tdb/>
>>>>> <http://**jena.apache.org/documentation/**tdb/<http://jena.apache.org/documentation/tdb/>
>>>>>>
>>>>>
>>>>> The pattern is similar:
>>>>>
>>>>> Dataset ds = TDBFactory.createDatatset(****directory) ;
>>>>>
>>>>>
>>>>> and use the dataset as normal.
>>>>>
>>>>> No formatting is necessary.
>>>>>
>>>>>           Andy
>>>>>
>>>>>
>>>>>   att
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> *Márcio Vinícius Oliveira Sena*
>> Bacharelando em Sistemas de Informação -  UFG
>> Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias Educacionais
>> - Labtime/UFG
>> Gerente de Projeto e Desenvolvedor Front-end
>> @marciosena17 <http://twitter.com/marciosena17>
>>
>>
>
>


Re: SDB to TDB

Posted by Márcio Vinicius <ma...@gmail.com>.
Andy, in relation to TDB have some application client to manage the files
for storing triples, such as phpMyAdmin or pgAdmin.

Cause I'm developing a large application and I think I need some
application that assist me file management has persisted.

thank you.


2013/9/16 Márcio Vinicius <ma...@gmail.com>

> Andy, you cleared my doubts. I am developing an application that requires
> a relational database (Postgres), because I register more than 60,000
> objects, as well as users and etc..
>
> Logo must use SDB. Thank you.
>
>
> 2013/9/15 Andy Seaborne <an...@apache.org>
>
>> On 13/09/13 21:18, Márcio Vinicius wrote:
>>
>>> Andy,
>>>
>>>           In Jena documentation, all the examples using the TDB does not
>>> use
>>> a relational database (MySQL or Postgres), is to use a bank or component
>>> is
>>> only TDB file?
>>>
>>
>> (sorry - I don't understand the last part of that sentence)
>>
>>
>>
>>>            It is recommended to use SDB on new projects? Because I read
>>> that
>>> it was not recommended.
>>>
>>
>> We do not recommend using SDB for new projects.  See [1]. There are cases
>> where SDB is necessary, typically where storing in an SQL databases is a
>> mandatory requirement of a project.  However, SDB does not scale as well as
>> TDB and is slower.  It does not get the same level of testing as other
>> components - the project relies on user reports and we do not have complete
>> coverage any more.
>>
>>         Andy
>>
>> [1] The wording we use visible at:
>>   http://jena.staging.apache.**org/documentation/sdb/<http://jena.staging.apache.org/documentation/sdb/>
>> and will be published to the main site in the next release.
>>
>>
>>> thank.
>>>
>>>
>>> 2013/9/3 Andy Seaborne <an...@apache.org>
>>>
>>>  On 03/09/13 19:35, Márcio Vinicius wrote:
>>>>
>>>>  Dear, I have studied the Jena for some time and did some test
>>>>> prototypes.
>>>>> In recent studies found that the documentation indicates the TDB
>>>>> component
>>>>> for development of new applications, but all prototypes that had made
>>>>> was
>>>>> based on SDB.
>>>>>
>>>>> Example of connection:
>>>>>
>>>>>         public Store getStore() {
>>>>>
>>>>> StoreDesc storeDesc = new StoreDesc(LayoutType.****
>>>>> LayoutTripleNodesHash,
>>>>>    DatabaseType.PostgreSQL);
>>>>> JDBC.loadDriverPGSQL();
>>>>>
>>>>> SDBConnection conn = new SDBConnection(Constants.DB_****URL,
>>>>>
>>>>>    Constants.DB_USER,
>>>>> Constants.DB_PASSWD);
>>>>>
>>>>> Store store = SDBFactory.connectStore(conn, storeDesc);
>>>>>    try {
>>>>> if (!StoreUtils.isFormatted(****store)) {
>>>>> store.getTableFormatter().****create();
>>>>>
>>>>>    }
>>>>> } catch (SQLException e) {
>>>>> e.printStackTrace();
>>>>>    }
>>>>> return store;
>>>>> }
>>>>>
>>>>> How do I use the component TDB?
>>>>>
>>>>>
>>>> Hi there,
>>>>
>>>> See
>>>>
>>>> http://jena.apache.org/****documentation/tdb/<http://jena.apache.org/**documentation/tdb/>
>>>> <http://**jena.apache.org/documentation/**tdb/<http://jena.apache.org/documentation/tdb/>
>>>> >
>>>>
>>>> The pattern is similar:
>>>>
>>>> Dataset ds = TDBFactory.createDatatset(****directory) ;
>>>>
>>>>
>>>> and use the dataset as normal.
>>>>
>>>> No formatting is necessary.
>>>>
>>>>          Andy
>>>>
>>>>
>>>>  att
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
>
> --
> *Márcio Vinícius Oliveira Sena*
> Bacharelando em Sistemas de Informação -  UFG
> Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias Educacionais
> - Labtime/UFG
> Gerente de Projeto e Desenvolvedor Front-end
> @marciosena17 <http://twitter.com/marciosena17>
>
>


-- 
*Márcio Vinícius Oliveira Sena*
Bacharelando em Sistemas de Informação -  UFG
Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias Educacionais
- Labtime/UFG
Gerente de Projeto e Desenvolvedor Front-end
@marciosena17 <http://twitter.com/marciosena17>

Re: SDB to TDB

Posted by Márcio Vinicius <ma...@gmail.com>.
Andy, you cleared my doubts. I am developing an application that requires a
relational database (Postgres), because I register more than 60,000
objects, as well as users and etc..

Logo must use SDB. Thank you.


2013/9/15 Andy Seaborne <an...@apache.org>

> On 13/09/13 21:18, Márcio Vinicius wrote:
>
>> Andy,
>>
>>           In Jena documentation, all the examples using the TDB does not
>> use
>> a relational database (MySQL or Postgres), is to use a bank or component
>> is
>> only TDB file?
>>
>
> (sorry - I don't understand the last part of that sentence)
>
>
>
>>            It is recommended to use SDB on new projects? Because I read
>> that
>> it was not recommended.
>>
>
> We do not recommend using SDB for new projects.  See [1]. There are cases
> where SDB is necessary, typically where storing in an SQL databases is a
> mandatory requirement of a project.  However, SDB does not scale as well as
> TDB and is slower.  It does not get the same level of testing as other
> components - the project relies on user reports and we do not have complete
> coverage any more.
>
>         Andy
>
> [1] The wording we use visible at:
>   http://jena.staging.apache.**org/documentation/sdb/<http://jena.staging.apache.org/documentation/sdb/>
> and will be published to the main site in the next release.
>
>
>> thank.
>>
>>
>> 2013/9/3 Andy Seaborne <an...@apache.org>
>>
>>  On 03/09/13 19:35, Márcio Vinicius wrote:
>>>
>>>  Dear, I have studied the Jena for some time and did some test
>>>> prototypes.
>>>> In recent studies found that the documentation indicates the TDB
>>>> component
>>>> for development of new applications, but all prototypes that had made
>>>> was
>>>> based on SDB.
>>>>
>>>> Example of connection:
>>>>
>>>>         public Store getStore() {
>>>>
>>>> StoreDesc storeDesc = new StoreDesc(LayoutType.****
>>>> LayoutTripleNodesHash,
>>>>    DatabaseType.PostgreSQL);
>>>> JDBC.loadDriverPGSQL();
>>>>
>>>> SDBConnection conn = new SDBConnection(Constants.DB_****URL,
>>>>
>>>>    Constants.DB_USER,
>>>> Constants.DB_PASSWD);
>>>>
>>>> Store store = SDBFactory.connectStore(conn, storeDesc);
>>>>    try {
>>>> if (!StoreUtils.isFormatted(****store)) {
>>>> store.getTableFormatter().****create();
>>>>
>>>>    }
>>>> } catch (SQLException e) {
>>>> e.printStackTrace();
>>>>    }
>>>> return store;
>>>> }
>>>>
>>>> How do I use the component TDB?
>>>>
>>>>
>>> Hi there,
>>>
>>> See
>>>
>>> http://jena.apache.org/****documentation/tdb/<http://jena.apache.org/**documentation/tdb/>
>>> <http://**jena.apache.org/documentation/**tdb/<http://jena.apache.org/documentation/tdb/>
>>> >
>>>
>>> The pattern is similar:
>>>
>>> Dataset ds = TDBFactory.createDatatset(****directory) ;
>>>
>>>
>>> and use the dataset as normal.
>>>
>>> No formatting is necessary.
>>>
>>>          Andy
>>>
>>>
>>>  att
>>>>
>>>>
>>>>
>>>
>>
>>
>


-- 
*Márcio Vinícius Oliveira Sena*
Bacharelando em Sistemas de Informação -  UFG
Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias Educacionais
- Labtime/UFG
Gerente de Projeto e Desenvolvedor Front-end
@marciosena17 <http://twitter.com/marciosena17>

Re: SDB to TDB

Posted by Andy Seaborne <an...@apache.org>.
On 13/09/13 21:18, Márcio Vinicius wrote:
> Andy,
>
>           In Jena documentation, all the examples using the TDB does not use
> a relational database (MySQL or Postgres), is to use a bank or component is
> only TDB file?

(sorry - I don't understand the last part of that sentence)

>
>            It is recommended to use SDB on new projects? Because I read that
> it was not recommended.

We do not recommend using SDB for new projects.  See [1]. There are 
cases where SDB is necessary, typically where storing in an SQL 
databases is a mandatory requirement of a project.  However, SDB does 
not scale as well as TDB and is slower.  It does not get the same level 
of testing as other components - the project relies on user reports and 
we do not have complete coverage any more.

	Andy

[1] The wording we use visible at:
   http://jena.staging.apache.org/documentation/sdb/
and will be published to the main site in the next release.

>
> thank.
>
>
> 2013/9/3 Andy Seaborne <an...@apache.org>
>
>> On 03/09/13 19:35, Márcio Vinicius wrote:
>>
>>> Dear, I have studied the Jena for some time and did some test prototypes.
>>> In recent studies found that the documentation indicates the TDB component
>>> for development of new applications, but all prototypes that had made was
>>> based on SDB.
>>>
>>> Example of connection:
>>>
>>>         public Store getStore() {
>>>
>>> StoreDesc storeDesc = new StoreDesc(LayoutType.**LayoutTripleNodesHash,
>>>    DatabaseType.PostgreSQL);
>>> JDBC.loadDriverPGSQL();
>>>
>>> SDBConnection conn = new SDBConnection(Constants.DB_**URL,
>>>    Constants.DB_USER,
>>> Constants.DB_PASSWD);
>>>
>>> Store store = SDBFactory.connectStore(conn, storeDesc);
>>>    try {
>>> if (!StoreUtils.isFormatted(**store)) {
>>> store.getTableFormatter().**create();
>>>    }
>>> } catch (SQLException e) {
>>> e.printStackTrace();
>>>    }
>>> return store;
>>> }
>>>
>>> How do I use the component TDB?
>>>
>>
>> Hi there,
>>
>> See
>>
>> http://jena.apache.org/**documentation/tdb/<http://jena.apache.org/documentation/tdb/>
>>
>> The pattern is similar:
>>
>> Dataset ds = TDBFactory.createDatatset(**directory) ;
>>
>> and use the dataset as normal.
>>
>> No formatting is necessary.
>>
>>          Andy
>>
>>
>>> att
>>>
>>>
>>
>
>


Re: SDB to TDB

Posted by Márcio Vinicius <ma...@gmail.com>.
Andy,

         In Jena documentation, all the examples using the TDB does not use
a relational database (MySQL or Postgres), is to use a bank or component is
only TDB file?

          It is recommended to use SDB on new projects? Because I read that
it was not recommended.

thank.


2013/9/3 Andy Seaborne <an...@apache.org>

> On 03/09/13 19:35, Márcio Vinicius wrote:
>
>> Dear, I have studied the Jena for some time and did some test prototypes.
>> In recent studies found that the documentation indicates the TDB component
>> for development of new applications, but all prototypes that had made was
>> based on SDB.
>>
>> Example of connection:
>>
>>        public Store getStore() {
>>
>> StoreDesc storeDesc = new StoreDesc(LayoutType.**LayoutTripleNodesHash,
>>   DatabaseType.PostgreSQL);
>> JDBC.loadDriverPGSQL();
>>
>> SDBConnection conn = new SDBConnection(Constants.DB_**URL,
>>   Constants.DB_USER,
>> Constants.DB_PASSWD);
>>
>> Store store = SDBFactory.connectStore(conn, storeDesc);
>>   try {
>> if (!StoreUtils.isFormatted(**store)) {
>> store.getTableFormatter().**create();
>>   }
>> } catch (SQLException e) {
>> e.printStackTrace();
>>   }
>> return store;
>> }
>>
>> How do I use the component TDB?
>>
>
> Hi there,
>
> See
>
> http://jena.apache.org/**documentation/tdb/<http://jena.apache.org/documentation/tdb/>
>
> The pattern is similar:
>
> Dataset ds = TDBFactory.createDatatset(**directory) ;
>
> and use the dataset as normal.
>
> No formatting is necessary.
>
>         Andy
>
>
>> att
>>
>>
>


-- 
*Márcio Vinícius Oliveira Sena*
Bacharelando em Sistemas de Informação -  UFG
Desenvolvedor Front-end no Laboratório de Tecnologia e Mídias Educacionais
- Labtime/UFG
Gerente de Projeto e Desenvolvedor Front-end
@marciosena17 <http://twitter.com/marciosena17>

Re: SDB to TDB

Posted by Andy Seaborne <an...@apache.org>.
On 03/09/13 19:35, Márcio Vinicius wrote:
> Dear, I have studied the Jena for some time and did some test prototypes.
> In recent studies found that the documentation indicates the TDB component
> for development of new applications, but all prototypes that had made was
> based on SDB.
>
> Example of connection:
>
>        public Store getStore() {
>
> StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash,
>   DatabaseType.PostgreSQL);
> JDBC.loadDriverPGSQL();
>
> SDBConnection conn = new SDBConnection(Constants.DB_URL,
>   Constants.DB_USER,
> Constants.DB_PASSWD);
>
> Store store = SDBFactory.connectStore(conn, storeDesc);
>   try {
> if (!StoreUtils.isFormatted(store)) {
> store.getTableFormatter().create();
>   }
> } catch (SQLException e) {
> e.printStackTrace();
>   }
> return store;
> }
>
> How do I use the component TDB?

Hi there,

See

http://jena.apache.org/documentation/tdb/

The pattern is similar:

Dataset ds = TDBFactory.createDatatset(directory) ;

and use the dataset as normal.

No formatting is necessary.

	Andy

>
> att
>