[d2rq-dev] Multiples D2R instances

2011-11-29 Thread Dominique Guardiola
Hello

I need to map different django sites hosted on the same server with D2R
One way to do it would be to use the same SQL database for all sites, but this 
make all triples part of the same graph, which is not the case

Regarding the java servlet, how is this possible ?
- running different configuration mapping under the same servlet ?
- running different servlets in the same container (I use jetty) ?

thanks for your help

--
Dominique Guardiola, QUINODE
• http://www.quinode.fr/
• Tel : 04.27.86.84.37
• Mob : 06.15.13.22.27






--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
d2rq-map-devel mailing list
d2rq-map-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel


Re: [d2rq-dev] Multiples D2R instances

2011-11-29 Thread Diogo FC Patrao
Hello Dominique

What I did (on a similar problem) was to lazily run several d2r-servers,
one for each database I wanted to serve, on different ports (2020, 2021,
2022, and so on)

You could* declare several d2r:database and map all you want in one single
instance, but it has already been stated by Richard that's not guarranteed
to work, and it's not what d2rq was intended to do.

My personal experience is that, as long as you don't map tables from
different databases into the same class, you should be fine. Example, say
you have dbs django1 and django2, and both have a table named "t". You
should map:

django1.t => namespace:class_t_1
django2.t => namespace:class_t_2

DON'T QUERY for both classes on the same sparql query. That is,

SELECT * {
  ?a a class_t_1;
  ?b a class_t_2;
}

That will work only if you query one concept at a time. Or else D2R would
join tables on different databases assuming they're in the same one, and
you probably don't want that.





--
diogo patrão





On Tue, Nov 29, 2011 at 7:10 AM, Dominique Guardiola
wrote:

> Hello
>
> I need to map different django sites hosted on the same server with D2R
> One way to do it would be to use the same SQL database for all sites, but
> this make all triples part of the same graph, which is not the case
>
> Regarding the java servlet, how is this possible ?
> - running different configuration mapping under the same servlet ?
> - running different servlets in the same container (I use jetty) ?
>
> thanks for your help
>
> --
> Dominique Guardiola, QUINODE
> • http://www.quinode.fr/
> • Tel : 04.27.86.84.37
> • Mob : 06.15.13.22.27
>
>
>
>
>
>
>
> --
> All the data continuously generated in your IT infrastructure
> contains a definitive record of customers, application performance,
> security threats, fraudulent activity, and more. Splunk takes this
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> ___
> d2rq-map-devel mailing list
> d2rq-map-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
>
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
d2rq-map-devel mailing list
d2rq-map-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel


[d2rq-dev] Problem with inference

2011-11-29 Thread Tran Thai Binh
Dear all,

I have a problem with inference value. I create two rdf files. One for
schema, one for data
For schema rdf file, I create subclass a2 of a1, and one dataproperty p1.
a2 have definition "a1 and p1 some float[>2]"

I expect some instant when I query for a2 but Jena returns nothing. I
attach rdf files and my code below. Could anyone help me to solve problem.

Thank in advance.
Binh



*(1) for schema*


http://www.w3.org/2002/07/owl#"; >
http://www.w3.org/2001/XMLSchema#"; >
http://www.w3.org/2000/01/rdf-schema#"; >
http://www.w3.org/1999/02/22-rdf-syntax-ns#"; >
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#"; >
]>
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#";
 xml:base="
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl";
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";
 xmlns:owl="http://www.w3.org/2002/07/owl#";
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#";
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
 xmlns:Ontology1322586150669="
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#";>
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl"/>





*(2) for data*

http://www.w3.org/2002/07/owl#"; >
http://www.w3.org/2001/XMLSchema#"; >
http://www.w3.org/2000/01/rdf-schema#"; >
http://www.w3.org/1999/02/22-rdf-syntax-ns#"; >
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#"; >
]>
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586466073.owl#";
 xml:base="
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586466073.owl";
 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";
 xmlns:owl="http://www.w3.org/2002/07/owl#";
 xmlns:xsd="http://www.w3.org/2001/XMLSchema#";
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
 xmlns:Ontology1322586150669="
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#";>
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586466073.owl"/>







*This is my code in Jena*

package query;
import com.hp.hpl.jena.query.*;
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.reasoner.*;
import com.hp.hpl.jena.util.FileManager;

public class query {

public static void main(String[] args) {

Model schema = FileManager.get().loadModel("O1.owl");
Model data = FileManager.get().loadModel("O2.owl");

Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
reasoner = reasoner.bindSchema(schema);
InfModel infmodel = ModelFactory.createInfModel(reasoner, data);

String queryString =
"PREFIX rdfs: "+
"PREFIX rdf: "+
"PREFIX test: <
http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#>"+
"select ?data " +
"where {?data a test:a2}";

Query query = QueryFactory.create(queryString);

System.out.println("--");
System.out.println("Query Result Sheet");
System.out.println("--");
System.out.println("Direct&Indirect Descendants (inf)");
System.out.println("---");

// Execute the query and obtain results
QueryExecution qe = QueryExecutionFactory.create(query,
infmodel);
ResultSet results = qe.execSelect();

// Output query results
ResultSetFormatter.out(System.out, results, query);

qe.close();
System.out.println("--");


}
}



-- 
Trần Thái Bình
GIS and Remote Sensing
thaibinht...@gmail.com
ttb...@vast-hcm.ac.vn
Phone: (848) 38247360
mobile:
- Việt Nam -
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
d2rq-map-devel mailing list
d2rq-map-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel


Re: [d2rq-dev] Problem with inference

2011-11-29 Thread Luis Ignacio Larrateguy
Hi Binh,
I couldn't find your reference to your mapping file. I don't think you are
going to get any inference on D2RQ. If you search on the list you'll find I
tried some aproaches, but all ended up bringing everything they need onto
memory (lot of SQL queries to end with an inferred model in-memory).
One approach would be to map, file the results obtained with the mapping,
use that file with your ontology and create an InfModel in Java (Jena).
If your question was related to Jena, then this is the wrong list :-(.

Regards
Nacho Larrateguy

On Tue, Nov 29, 2011 at 2:39 PM, Tran Thai Binh wrote:

> Dear all,
>
> I have a problem with inference value. I create two rdf files. One for
> schema, one for data
> For schema rdf file, I create subclass a2 of a1, and one dataproperty p1.
> a2 have definition "a1 and p1 some float[>2]"
>
> I expect some instant when I query for a2 but Jena returns nothing. I
> attach rdf files and my code below. Could anyone help me to solve problem.
>
> Thank in advance.
> Binh
>
>
>
> *(1) for schema*
>
> 
>  http://www.w3.org/2002/07/owl#"; >
> http://www.w3.org/2001/XMLSchema#"; >
> http://www.w3.org/2000/01/rdf-schema#"; >
> http://www.w3.org/1999/02/22-rdf-syntax-ns#"; >
>  http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#";
> >
> ]>
> http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#";
>  xml:base="
> http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl";
>  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";
>  xmlns:owl="http://www.w3.org/2002/07/owl#";
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema#";
>  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
>  xmlns:Ontology1322586150669="
> http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#";>
> http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl"/>
> 
> 
> 
> ///
> //
> // Classes
> //
>
> ///
>  -->
>  http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#a2-->
> 
> 
> 
> 
>  rdf:about="&Ontology1322586150669;a1"/>
> 
>  rdf:resource="&Ontology1322586150669;p1"/>
> 
> 
> 
>  rdf:parseType="Collection">
> 
>  rdf:datatype="&xsd;integer">2
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>
> *(2) for data*
> 
>  http://www.w3.org/2002/07/owl#"; >
> http://www.w3.org/2001/XMLSchema#"; >
> http://www.w3.org/2000/01/rdf-schema#"; >
> http://www.w3.org/1999/02/22-rdf-syntax-ns#"; >
>  http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#";
> >
> ]>
> http://www.semanticweb.org/ontologies/2011/10/Ontology1322586466073.owl#";
>  xml:base="
> http://www.semanticweb.org/ontologies/2011/10/Ontology1322586466073.owl";
>  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#";
>  xmlns:owl="http://www.w3.org/2002/07/owl#";
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema#";
>  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
>  xmlns:Ontology1322586150669="
> http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#";>
> http://www.semanticweb.org/ontologies/2011/10/Ontology1322586466073.owl"/>
> 
> 
> 
> ///
> //
> // Classes
> //
>
> ///
>  -->
> 
> ///
> //
> // Individuals
> //
>
> ///
>  -->
>  http://www.semanticweb.org/ontologies/2011/10/Ontology1322586150669.owl#rf-->
> 
> 
>  rdf:datatype="&xsd;float">16
> 
> 
> 
>
>
> *This is my code in Jena*
>
> package query;
> import com.hp.hpl.jena.query.*;
> import com.hp.hpl.jena.rdf.model.*;
> import com.hp.hpl.jena.reasoner.*;
> import com.hp.hpl.jena.util.FileManager;
>
> public class query {
>
> public static void main(String[] args) {
>
> Model schema = FileManager.get().loadModel("O1.owl");
> Model data = FileManager.get().loadModel("O2.owl");
>
> Reasoner reasoner = ReasonerRegistry.getOWLReasoner();
> reasoner = reason