Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] Jena on top of SQL db

Jim,

> We were looking at the jena CP and the unit tests and wondering how it works with an SQL database.  

> We didn't see any kind of ontology checked into the jena test project.

> Is there something that can be configured to map table names and column names to attributes?  

> If so, where are those mappings defined? 



Jena2 CP uses Jena ontology library to operate with data, so all data is stored in the form of an ontology document (just as JNDI CP uses LDAP server to store its data). This ontology document can be stored within the file or database. So, there are two types of Jena CP contexts: FileContext and JDBCContext. In case if Jena is configured to use database, it generates database structure by itself. So, you just need to create empty database schema and configure the context to use that schema. I've updated idas.cp.jena2.test project, and it contains /cfg/testSchema.owl file now. This file is HOWL schema which defines the structure of data (DigtialSubjects, Attributes etc.) stored within IdAS context. Also there are two examples of configuration: file-based (see /cfg/file.xrds) and JDBC-based (see /cfg/jdbc_mysql.xrds). idas.cp.jena2.test project uses /cfg/file.xrds by default.



Both configuration files contain "schema.url" and  "schema.file" settings.They define which HOWL schema will be used.

file.xrds contains "context.file" setting which defines where IdAS data will be stored in case of file-based CP.

jdbc_mysql.xrds contans a few  "db." settings which define where data will be stored in case of JDBC-based CP.

    

> How are the table names and column names determined when methods like 

> Context.getSubject(String), Context.getSubject(IFilter), Context.addSubject(URI, String) are called?



The SPARQL language (similar to SQL, http://jena.sourceforge.net/ARQ/Tutorial/) is used to query data from ontology documents. So, I generate a SPARQL query in Context.getSubject(String), Context.getSubject(IFilter) methods and execute it against the ontology document. Jena lib responds to execute this query and return an appropriate data.



Thanks,
Sergey Lyakhov

  ----- Original Message ----- 
  From: Jim Sermersheim 
  To: Higgins dev <higgins-dev@xxxxxxxxxxx 
  Sent: Friday, January 25, 2008 11:03 PM
  Subject: [higgins-dev] Jena on top of SQL db


  Sergey, 



  We were looking at the jena CP and the unit tests and wondering how it works with an SQL database.  We didn't see any kind of ontology checked into the jena test project. 



  How are the table names and column names determined when methods like Context.getSubject(String), Context.getSubject(IFilter), Context.addSubject(URI, String) are called? 



  Is there something that can be configured to map table names and column names to attributes?  If so, where are those mappings defined? 



  Thanks! 



------------------------------------------------------------------------------


  _______________________________________________
  higgins-dev mailing list
  higgins-dev@xxxxxxxxxxx
  https://dev.eclipse.org/mailman/listinfo/higgins-dev

Back to the top