<< Create the MySql Database || Homepage || Set up Maven and Tomcat >>

  1. Connect to MySql from Eclipse
    1. Working in the cloud -- domain names and host file
    2. Establishing connections
    3. Creating the Jena schema
    4. Things to notice

Connect to MySql from Eclipse

These are the last steps in a series of preparations of a basic platform from which to work.

Working in the cloud — domain names and host file

An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use localhost as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples are supposed to have formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema

For that reason we are going to assign domain names and use them locally in our host file. Here’s one of many very short videos that show you how to do it.

I have set mine up like this:

192.168.0.2db.mowa.justtrade.net
192.168.0.3www.mowa.justtrade.net
192.168.0.3rest.mowa.justtrade.net
192.168.0.3rdfs.mowa.justtrade.net

At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3

All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases.

  • db — the backend database
  • www — for any non-REST application server work (such as an application server serving AJAX)
  • rest — for REST style data serving (may be a back.end for www)
  • rdfs — for holding RDF namespace and schema information

Establishing connections

Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which JENA is going to want to do initially).

Although Eclipse reports that all is fine we will probably encounter a run-time exception:

The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver.

The solution is to repeat these steps but this time creating a library containing your MySql drivers.

A successful result looks like this ...

Creating the Jena schema

As our final task in this tutorial we’ll instantiate an RDF store in the database.

To begin from known foundations, let’s ensure we have an empty database. In the %checked_out%\tutorials sub-directory of the directory you checked out of version control, there is a file createDropTablesScript.sql. Execute it like this :

e:
cd \projects\MOWa\tutorials
mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa
mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql
more dropTablesScript.sql
mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql
mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa
del dropTablesScript.sql

The end result should look like this. Note : be sure you get the whole length of the 4th line.

Returning to Eclipse, you should have a Java application "“ in the path ”". If it is showing dependencies errors be sure you repeat the instructions in Get the project into Eclipse#Setup third party libraries..

If you have followed all the preceding steps, you should not need to do any more now than simply run it.

The end result, should look this ...

The complete end-result looks like this:

I'm alive.
Create JENA database connection
Open existing model, or Create a new one, if none exists.
Create some sort of resource
Create some sort of property
Attach the property to the resource.
Commit changes
Have JENA show what we got in *various export formats* ....
---------------- RDF/XML ------------------
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:j.0="http://example.com/test example " > 
  <rdf:Description rdf:about="http://example.com/test example Resource.">
    <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string">*** MOWa ***</j.0:Property.>
  </rdf:Description>
</rdf:RDF>

------------- RDF/XML-ABBREV  -------------
<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:j.0="http://example.com/test example ">
  <rdf:Description rdf:about="http://example.com/test example Resource.">
    <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
    >*** MOWa ***</j.0:Property.>
  </rdf:Description>
</rdf:RDF>

---------------- N-TRIPLE -----------------
<http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> .

----------------- TURTLE ------------------
<http://example.com/test example Resource.>
      <http://example.com/test example Property.>
              "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> .

-------------------------------------------
Close the JENA connection
Create standard JDBC database connection
Connected to MySQL server.
Executing : select Subj, Prop, Obj, GraphID from jena_g1t1_stmt
Have SQL show what we got ....
-------------------------------------------
 - Subj    =   Uv::http://example.com/test example Resource.:
 - Prop    =   Uv::http://example.com/test example Property.:
 - Obj     =   Lv:0:39:http://www.w3.org/2001/XMLSchema#string*** MOWa ***:
 - GraphID =   1
-------------------------------------------

We're done.

I’ve coded output after every line, so it ought to be fully self-explanatory.

Things to notice

  1. Thanks to the comprehensive design of Jena, there is very little coding work involved. That single java program handles database creation and insertion of data aas well as retrieval of data in various formats.
  2. RDF tuples are extremely simple: an identifier such as http://example.com/test example Resource., with one or more properties. Properties are defined more or less the same way: an identifier and a value, like this http://example.com/test example Property. = *** MOWa ***. The values can be of many types, so a type definition can be included, like this http://www.w3.org/2001/XMLSchema#string*** MOWa ***
  3. This is not yet OWL. In describing the real world, things can be understood on their own as something has such and such properties. RDF goes no further. OWL does. OWL describes things in context and with relationships.

<< Create the MySql Database || Homepage || Set up Maven and Tomcat >>

Connect to MySql from Eclipse is a public wiki page

This wiki page is a public wiki page. It can be read by anyone including users that have not logged in and web crawlers such as Google.

Entry has no comments

You do not have sufficient permissions to comment

7 years ago
hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! The complete end-result looks like this: pre.. I'm alive. Create JENA database connection Open existing model, or Create a new one, if none exists. Create some sort of resource Create some sort of property Attach the property to the resource. Commit changes Have JENA show what we got in *various export formats* .... ---------------- RDF/XML ------------------ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example " > <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string">*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ------------- RDF/XML-ABBREV ------------- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example "> <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ---------------- N-TRIPLE ----------------- <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ----------------- TURTLE ------------------ <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ------------------------------------------- Close the JENA connection Create standard JDBC database connection Connected to MySQL server. Executing : select Subj, Prop, Obj, GraphID from jena_g1t1_stmt Have SQL show what we got .... ------------------------------------------- - Subj = Uv::http://example.com/test example Resource.: - Prop = Uv::http://example.com/test example Property.: - Obj = Lv:0:39:http://www.w3.org/2001/XMLSchema#string*** MOWa ***: - GraphID = 1 ------------------------------------------- We're done. p. I've coded output after every line, so it ought to be fully self-explanatory. h3. Things to notice # Thanks to the comprehensive design of Jena, there is very little coding work involved. That single java program handles database creation and insertion of data aas well as retrieval of data in various formats. # RDF tuples are extremely simple: an identifier such as @http://example.com/test example Resource.@, with one or more properties. Properties are defined more or less the same way: an identifier and a value, like this @http://example.com/test example Property.@ = @*** MOWa ***@. The values can be of many types, so a type definition can be included, like this @http://www.w3.org/2001/XMLSchema#string*** MOWa ***@ # This is not yet OWL. In describing the real world, things can be understood on their own as @something has such and such properties@. RDF goes no further. OWL does. OWL describes things in context and with relationships. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> {toc} h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! The complete end-result looks like this: pre.. I'm alive. Create JENA database connection Open existing model, or Create a new one, if none exists. Create some sort of resource Create some sort of property Attach the property to the resource. Commit changes Have JENA show what we got in *various export formats* .... ---------------- RDF/XML ------------------ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example " > <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string">*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ------------- RDF/XML-ABBREV ------------- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example "> <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ---------------- N-TRIPLE ----------------- <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ----------------- TURTLE ------------------ <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ------------------------------------------- Close the JENA connection Create standard JDBC database connection Connected to MySQL server. Executing : select Subj, Prop, Obj, GraphID from jena_g1t1_stmt Have SQL show what we got .... ------------------------------------------- - Subj = Uv::http://example.com/test example Resource.: - Prop = Uv::http://example.com/test example Property.: - Obj = Lv:0:39:http://www.w3.org/2001/XMLSchema#string*** MOWa ***: - GraphID = 1 ------------------------------------------- We're done. p. I've coded output after every line, so it ought to be fully self-explanatory. h3. Things to notice # Thanks to the comprehensive design of Jena, there is very little coding work involved. That single java program handles database creation and insertion of data aas well as retrieval of data in various formats. # RDF tuples are extremely simple: an identifier such as @http://example.com/test example Resource.@, with one or more properties. Properties are defined more or less the same way: an identifier and a value, like this @http://example.com/test example Property.@ = @*** MOWa ***@. The values can be of many types, so a type definition can be included, like this @http://www.w3.org/2001/XMLSchema#string*** MOWa ***@ # This is not yet OWL. In describing the real world, things can be understood on their own as @something has such and such properties@. RDF goes no further. OWL does. OWL describes things in context and with relationships. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! The complete end-result looks like this: pre.. I'm alive. Create JENA database connection Open existing model, or Create a new one, if none exists. Create some sort of resource Create some sort of property Attach the property to the resource. Commit changes Have JENA show what we got in *various export formats* .... ---------------- RDF/XML ------------------ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example " > <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string">*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ------------- RDF/XML-ABBREV ------------- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example "> <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ---------------- N-TRIPLE ----------------- <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ----------------- TURTLE ------------------ <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ------------------------------------------- Close the JENA connection Create standard JDBC database connection Connected to MySQL server. Executing : select Subj, Prop, Obj, GraphID from jena_g1t1_stmt Have SQL show what we got .... ------------------------------------------- - Subj = Uv::http://example.com/test example Resource.: - Prop = Uv::http://example.com/test example Property.: - Obj = Lv:0:39:http://www.w3.org/2001/XMLSchema#string*** MOWa ***: - GraphID = 1 ------------------------------------------- We're done. p. I've coded output after every line, so it ought to be fully self-explanatory. h3. Things to notice # Thanks to the comprehensive design of Jena, there is very little coding work involved. That single java program handles database creation and insertion of data aas well as retrieval of data in various formats. # RDF tuples are extremely simple: an identifier such as "http://example.com/test example Resource.", with one or more properties. Properties are defined more or less the same way: an identifier and a value, like this "http://example.com/test example Property." = "* * * MOWa * * *". The values can be of many types, so a type definition can be included, like this "http://www.w3.org/2001/XMLSchema#string* * * MOWa * * *" # This is not yet OWL. In describing the real world, things can be understood on their own as "something has such and such properties". RDF goes no further. OWL does. OWL describes things in context and with relationships. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! The complete end-result looks like this: pre.. I'm alive. Create JENA database connection Open existing model, or Create a new one, if none exists. Create some sort of resource Create some sort of property Attach the property to the resource. Commit changes Have JENA show what we got in *various export formats* .... ---------------- RDF/XML ------------------ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example " > <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string">*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ------------- RDF/XML-ABBREV ------------- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example "> <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ---------------- N-TRIPLE ----------------- <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ----------------- TURTLE ------------------ <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ------------------------------------------- Close the JENA connection Create standard JDBC database connection Connected to MySQL server. Executing : select Subj, Prop, Obj, GraphID from jena_g1t1_stmt Have SQL show what we got .... ------------------------------------------- - Subj = Uv::http://example.com/test example Resource.: - Prop = Uv::http://example.com/test example Property.: - Obj = Lv:0:39:http://www.w3.org/2001/XMLSchema#string*** MOWa ***: - GraphID = 1 ------------------------------------------- We're done. p. I've coded output after every line, so it ought to be fully self-explanatory. h3. Things to notice # Thanks to the comprehensive design of Jena, there is very little coding work involved. That single java program handles database creation and insertion of data aas well as retrieval of data in various formats. # RDF tuples are extremely simple: an identifier such as @http://example.com/test example Resource.@, with one or more properties. Properties are defined more or less the same way: an identifier and a value, like this @http://example.com/test example Property.@ = @*** MOWa ***@. The values can be of many types, so a type definition can be included, like this @http://www.w3.org/2001/XMLSchema#string*** MOWa ***@ # This is not yet OWL. In describing the real world, things can be understood on their own as @something has such and such properties@. RDF goes no further. OWL does. OWL describes things in context and with relationships. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! The complete end-result looks like this: pre.. I'm alive. Create JENA database connection Open existing model, or Create a new one, if none exists. Create some sort of resource Create some sort of property Attach the property to the resource. Commit changes Have JENA show what we got in *various export formats* .... ---------------- RDF/XML ------------------ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example " > <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string">*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ------------- RDF/XML-ABBREV ------------- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example "> <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ---------------- N-TRIPLE ----------------- <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ----------------- TURTLE ------------------ <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ------------------------------------------- Close the JENA connection Create standard JDBC database connection Connected to MySQL server. Executing : select Subj, Prop, Obj, GraphID from jena_g1t1_stmt Have SQL show what we got .... ------------------------------------------- - Subj = Uv::http://example.com/test example Resource.: - Prop = Uv::http://example.com/test example Property.: - Obj = Lv:0:39:http://www.w3.org/2001/XMLSchema#string*** MOWa ***: - GraphID = 1 ------------------------------------------- We're done. p. I've coded output after every line, so it ought to be fully self-explanatory. h3. Things to notice # Thanks to the comprehensive design of Jena, there is very little coding work involved. That single java program handles database creation and insertion of data aas well as retrieval of data in various formats. # RDF tuples are extremely simple: an identifier such as "http://example.com/test example Resource.", with one or more properties. Properties are defined more or less the same way: an identifier and a value, like this "http://example.com/test example Property." = "*** MOWa ***". The values can be of many types, so a type definition can be included, like this "http://www.w3.org/2001/XMLSchema#string*** MOWa ***" # This is not yet OWL. In describing the real world, things can be understood on their own as "something has such and such properties". RDF goes no further. OWL does. OWL describes things in context and with relationships. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! The complete end-result looks like this: pre.. I'm alive. Create JENA database connection Open existing model, or Create a new one, if none exists. Create some sort of resource Create some sort of property Attach the property to the resource. Commit changes Have JENA show what we got in *various export formats* .... ---------------- RDF/XML ------------------ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example " > <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string">*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ------------- RDF/XML-ABBREV ------------- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example "> <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ---------------- N-TRIPLE ----------------- <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ----------------- TURTLE ------------------ <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ------------------------------------------- Close the JENA connection Create standard JDBC database connection Connected to MySQL server. Executing : select Subj, Prop, Obj, GraphID from jena_g1t1_stmt Have SQL show what we got .... ------------------------------------------- - Subj = Uv::http://example.com/test example Resource.: - Prop = Uv::http://example.com/test example Property.: - Obj = Lv:0:39:http://www.w3.org/2001/XMLSchema#string*** MOWa ***: - GraphID = 1 ------------------------------------------- We're done. p. I've coded output after every line, so it ought to be fully self-explanatory. h3. Things to notice # Thanks to the comprehensive design of Jena, there is very little coding work involved. That single java program handles database creation and insertion of data aas well as retrieval of data in various formats. # RDF tuples are extremely simple: an identifier such as "http://example.com/test example Resource.", with one or more properties. Properties are defined more or less the same way: an identifier and a value, like this "http://example.com/test example Property." = "* * * MOWa * * *". The values can be of many types, so a type definition can be included, like this "http://www.w3.org/2001/XMLSchema#string* * * MOWa * * *" # This is not yet OWL. In describing the real world, things can be understood on their own as "something has such and such properties". RDF goes no further. OWL does. OWL describes things in context and with relationships. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! pre..package persistence; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import com.hp.hpl.jena.datatypes.xsd.XSDDatatype; import com.hp.hpl.jena.db.DBConnection; import com.hp.hpl.jena.db.IDBConnection; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.ModelMaker; import com.hp.hpl.jena.rdf.model.Property; import com.hp.hpl.jena.rdf.model.Resource; public class InstantiateSchema { /** * @param args */ public static void main(String[] args) { String hello = "I'm alive."; System.out.println(hello); String DB_URL = "jdbc:mysql://localhost/mowa"; // URL of database String DB_USER = "mowa_user"; // database user id String DB_PASSWD = "someDumbPWord"; // database password String DB = "MySQL"; // database type String sModel = "MOWa"; String NS = "http://example.com/test"; Resource someResource = null; Property someProperty = null; Connection jdbcConn = null; try { String className = "com.mysql.jdbc.Driver"; // path of driver class Class.forName (className); // Load the Driver System.out.println("Create database connection"); IDBConnection conn = new DBConnection ( DB_URL, DB_USER, DB_PASSWD, DB ); ModelMaker maker = ModelFactory.createModelRDBMaker(conn) ; // create or open the MOWa model"); Model model = maker.openModel(sModel, false); model.begin(); System.out.println("Create some sort a resource"); someResource = model.createResource(NS + " example Resource."); someProperty = model.createProperty(NS + " example Property."); someResource.addProperty(someProperty, "*** MOWa ***", XSDDatatype.XSDstring); System.out.println("Commit changes"); model.commit(); System.out.println("Have JENA show what we got ...." + "\n---------------- RDF/XML ------------------"); model.write(System.out, "RDF/XML"); System.out.println("\n------------- RDF/XML-ABBREV -------------"); model.write(System.out, "RDF/XML-ABBREV"); System.out.println("\n---------------- N-TRIPLE -----------------"); model.write(System.out, "N-TRIPLE"); System.out.println("\n----------------- TURTLE ------------------"); model.write(System.out, "TURTLE"); System.out.println("\n-------------------------------------------"); System.out.println("Close the database connection"); conn.close(); jdbcConn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWD); if(!jdbcConn.isClosed()) { System.out.println("Connected to MySQL server."); Statement stmt = jdbcConn.createStatement(); String sSelect = "select Subj, Prop, Obj, GraphID from jena_g1t1_stmt"; System.out.println("Executing : " + sSelect); ResultSet rSet = stmt.executeQuery(sSelect); rSet.next(); System.out.println("Have SQL show what we got ....\n-------------------------------------------" + "\n - Subj = " + rSet.getString("Subj") + "\n - Prop = " + rSet.getString("Prop") + "\n - Obj = " + rSet.getString("Obj") + "\n - GraphID = " + rSet.getInt ("GraphID") ); System.out.println("-------------------------------------------\n"); } System.out.println("We're done."); } catch (ClassNotFoundException ex) { System.out.println("Can't find the MySQL driver."); } catch (SQLException e) { System.out.println("Can't work the connection"); } } } p. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! The complete end-result looks like this: pre.. I'm alive. Create JENA database connection Open existing model, or Create a new one, if none exists. Create some sort of resource Create some sort of property Attach the property to the resource. Commit changes Have JENA show what we got in *various export formats* .... ---------------- RDF/XML ------------------ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example " > <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string">*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ------------- RDF/XML-ABBREV ------------- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:j.0="http://example.com/test example "> <rdf:Description rdf:about="http://example.com/test example Resource."> <j.0:Property. rdf:datatype="http://www.w3.org/2001/XMLSchema#string" >*** MOWa ***</j.0:Property.> </rdf:Description> </rdf:RDF> ---------------- N-TRIPLE ----------------- <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ----------------- TURTLE ------------------ <http://example.com/test example Resource.> <http://example.com/test example Property.> "*** MOWa ***"^^<http://www.w3.org/2001/XMLSchema#string> . ------------------------------------------- Close the JENA connection Create standard JDBC database connection Connected to MySQL server. Executing : select Subj, Prop, Obj, GraphID from jena_g1t1_stmt Have SQL show what we got .... ------------------------------------------- - Subj = Uv::http://example.com/test example Resource.: - Prop = Uv::http://example.com/test example Property.: - Obj = Lv:0:39:http://www.w3.org/2001/XMLSchema#string*** MOWa ***: - GraphID = 1 ------------------------------------------- We're done. p. I've coded output after every line, so it ought to be fully self-explanatory. h3. Things to notice # Thanks to the comprehensive design of Jena, there is very little coding work involved. That single java program handles database creation and insertion of data aas well as retrieval of data in various formats. # RDF tuples are extremely simple: an identifier such as "http://example.com/test example Resource.", with one or more properties. Properties are defined more or less the same way: an identifier and a value, like this "http://example.com/test example Property." = "*** MOWa ***". The values can be of many types, so a type definition can be included, like this "http://www.w3.org/2001/XMLSchema#string*** MOWa ***" # This is not yet OWL. In describing the real world, things can be understood on their own as "something has such and such properties". RDF goes no further. OWL does. OWL describes things in context and with relationships. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! pre..package persistence; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import com.hp.hpl.jena.datatypes.xsd.XSDDatatype; import com.hp.hpl.jena.db.DBConnection; import com.hp.hpl.jena.db.IDBConnection; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.ModelMaker; import com.hp.hpl.jena.rdf.model.Property; import com.hp.hpl.jena.rdf.model.Resource; public class InstantiateSchema { /** * @param args */ public static void main(String[] args) { String hello = "I'm alive."; System.out.println(hello); String DB_URL = "jdbc:mysql://localhost/mowa"; // URL of database String DB_USER = "mowa_user"; // database user id String DB_PASSWD = "someDumbPWord"; // database password String DB = "MySQL"; // database type String sModel = "MOWa"; String NS = "http://example.com/test"; Resource someResource = null; Property someProperty = null; Connection jdbcConn = null; try { String className = "com.mysql.jdbc.Driver"; // path of driver class Class.forName (className); // Load the Driver System.out.println("Create database connection"); IDBConnection conn = new DBConnection ( DB_URL, DB_USER, DB_PASSWD, DB ); ModelMaker maker = ModelFactory.createModelRDBMaker(conn) ; // create or open the MOWa model"); Model model = maker.openModel(sModel, false); model.begin(); System.out.println("Create some sort a resource"); someResource = model.createResource(NS + " example Resource."); someProperty = model.createProperty(NS + " example Property."); someResource.addProperty(someProperty, "*** MOWa ***", XSDDatatype.XSDstring); System.out.println("Commit changes"); model.commit(); System.out.println("Have JENA show what we got ...." + "\n---------------- RDF/XML ------------------"); model.write(System.out, "RDF/XML"); System.out.println("\n------------- RDF/XML-ABBREV -------------"); model.write(System.out, "RDF/XML-ABBREV"); System.out.println("\n---------------- N-TRIPLE -----------------"); model.write(System.out, "N-TRIPLE"); System.out.println("\n----------------- TURTLE ------------------"); model.write(System.out, "TURTLE"); System.out.println("\n-------------------------------------------"); System.out.println("Close the database connection"); conn.close(); jdbcConn = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWD); if(!jdbcConn.isClosed()) { System.out.println("Connected to MySQL server."); Statement stmt = jdbcConn.createStatement(); String sSelect = "select Subj, Prop, Obj, GraphID from jena_g1t1_stmt"; System.out.println("Executing : " + sSelect); ResultSet rSet = stmt.executeQuery(sSelect); rSet.next(); System.out.println("Have SQL show what we got ....\n-------------------------------------------" + "\n - Subj = " + rSet.getString("Subj") + "\n - Prop = " + rSet.getString("Prop") + "\n - Obj = " + rSet.getString("Obj") + "\n - GraphID = " + rSet.getInt ("GraphID") ); System.out.println("-------------------------------------------\n"); } System.out.println("We're done."); } catch (ClassNotFoundException ex) { System.out.println("Can't find the MySQL driver."); } catch (SQLException e) { System.out.println("Can't work the connection"); } } } p. << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries. If you have followed all the preceding steps, you should not need to do any more now than simply run it. !http://www.xp-dev.com/file/6569! The end result, should look this ... !http://www.xp-dev.com/file/6570! << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! Returning to Eclipse, you should have a Java application "" in the path "". If it is showing dependencies errors be sure you repeat the instructions in "Get the project into Eclipse#Setup third party libraries.":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line. !http://www.xp-dev.com/file/6565! << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

Text: << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. C:\>e: E:\>cd \projects\MOWa\tutorials E:\projects\MOWa\tutorials>mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa E:\projects\MOWa\tutorials>mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql E:\projects\MOWa\tutorials>more dropTablesScript.sql E:\projects\MOWa\tutorials>mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql E:\projects\MOWa\tutorials>mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa E:\projects\MOWa\tutorials> << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >><< [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >> h1. Connect to MySql from Eclipse These are the last steps in a series of preparations of a basic platform from which to work. h3. Working in the cloud -- domain names and host file An important characteristic of the later platform will be that it will be distributed across the web. It is easy enough to consistently use _localhost_ as the server and develop the whole project there, but we will want to be sure we can easily grow out of that. Furthermore, both the subject and predicate nodes of RDF tuples *are supposed to have* formal domain names in order to guarantee that they are unique. Predicate nodes that refer to public standard RDF schema items require the domain of the remote schema For that reason we are going to assign domain names and use them locally in our host file. Here's "one of many very short videos":http://www.youtube.com/watch?v=zSN-EJqTP-0&feature=related that show you how to do it. I have set mine up like this: |@192.168.0.2@|@db.mowa.justtrade.net@| |@192.168.0.3@|@www.mowa.justtrade.net@| |@192.168.0.3@|@rest.mowa.justtrade.net@| |@192.168.0.3@|@rdfs.mowa.justtrade.net@| _At the moment I have only the database server on a separate machine 192.168.0.2 The rest is all in the local machine to which I have assigned the address 192.168.0.3_ All examples will be using those, and there may be more needed later on. They will be hard coded right into some examples, and put into properties files in other cases. * db -- the backend database * www -- for any non-REST application server work (such as an application server serving AJAX) * rest -- for REST style data serving (may be a back.end for www) * rdfs -- for holding RDF namespace and schema information h3. Establishing connections Shown below is a script for testing that it is possible to connect to a permanent data store from a java program. More specifically it tests that a Java DataBase Connectivity (JDBC) connection can be established to the MySql relational database server. It also checks that the connection has the necessary privileges to create, write to and drop tables (which *JENA* is going to want to do initially). !http://www.xp-dev.com/file/6118! Although Eclipse reports that all is fine we will probably encounter a run-time exception: !http://www.xp-dev.com/file/6391! !http://www.xp-dev.com/file/6121! The red console message is telling us that Eclipse needs to know where to find com.mysql.jdbc.Driver. The solution is to repeat "these steps":http://www.xp-dev.com/wiki/115819/Get%20the%20project%20into%20Eclipse#Setupthirdpartylibraries but this time creating a library containing your MySql drivers. A successful result looks like this ... !http://www.xp-dev.com/file/6133! h3. Creating the Jena schema As our final task in this tutorial we'll instantiate an RDF store in the database. To begin from known foundations, let's ensure we have an empty database. In the @%checked_out%\tutorials@ sub-directory of the directory you checked out of version control, there is a file @createDropTablesScript.sql@. Execute it like this : pre.. e: cd \projects\MOWa\tutorials mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < createDropTablesScript.sql > dropTablesScript.sql more dropTablesScript.sql mysql -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa < dropTablesScript.sql mysql -e "show tables;" -h db.mowa.justtrade.net -u mowa_user -psomeDumbPWord mowa del dropTablesScript.sql p. The end result should look like this. Note : be sure you get the whole length of the 4th line << [Create the MySql Database] || [Homepage] || [Set up Maven and Tomcat] >>

hasan.bramwell picture
hasan.bramwell updated Wiki Connect to MySql from Eclipse

View View full history