Hi Binh,
The problem is not with the mapping file but with the Java classpath. Either
the commons-logging.jar file is missing from the classpath, or it is a wrong
version of the jar file on the classpath. Make sure that all the jar files
included with the D2R download are on the classpath, and make sure that no
other versions of commons-logging.jar (perhaps from some other project that
you're using) are on the classpath.
All the best,
Richard
On 24 Nov 2011, at 11:52, Tran Thai Binh wrote:
> Dear,
> I got error when create a model
> ---
> package mappingfile;
>
> import com.hp.hpl.jena.query.Query;
> import com.hp.hpl.jena.query.QueryExecution;
> import com.hp.hpl.jena.query.QueryExecutionFactory;
> import com.hp.hpl.jena.query.QueryFactory;
> import com.hp.hpl.jena.query.ResultSetFormatter;
> import com.hp.hpl.jena.rdf.model.Model;
> import com.hp.hpl.jena.rdf.model.ModelFactory;
> import com.hp.hpl.jena.rdf.model.Property;
> import com.hp.hpl.jena.rdf.model.Resource;
> import com.hp.hpl.jena.util.FileManager;
>
> import de.fuberlin.wiwiss.d2rq.ModelD2RQ;
>
> public class mappingfile {
> public static void main(String[] args) {
> // Set up the ModelD2RQ using a mapping file
> Model mappingModel = new ModelD2RQ("testing6.n3");
> }
> }
> --
> Exception in thread "main" java.lang.
> NoClassDefFoundError: org/apache/commons/logging/LogFactory
> at de.fuberlin.wiwiss.d2rq.map.ClassMap.<init>(ClassMap.java:29)
> at
> de.fuberlin.wiwiss.d2rq.parser.MapParser.parseClassMaps(MapParser.java:339)
> at de.fuberlin.wiwiss.d2rq.parser.MapParser.parse(MapParser.java:100)
> at de.fuberlin.wiwiss.d2rq.GraphD2RQ.<init>(GraphD2RQ.java:74)
> at de.fuberlin.wiwiss.d2rq.ModelD2RQ.<init>(ModelD2RQ.java:61)
> at de.fuberlin.wiwiss.d2rq.ModelD2RQ.<init>(ModelD2RQ.java:35)
> at mappingfile.mappingfile.main(mappingfile.java:19)
> Caused by: java.lang.ClassNotFoundException:
> org.apache.commons.logging.LogFactory
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> ... 7 more
> --
> when create a model with
> @prefix map: <http://www.owl-ontologies.com/DataDomain.owl#> .
> @prefix db: <> .
> @prefix vocab: <http://localhost:2020/vocab/resource/> .
> @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
> @prefix d2rq: <http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#> .
> @prefix jdbc: <http://d2rq.org/terms/jdbc/> .
> @prefix owl: <http://www.w3.org/2002/07/owl#>.
>
>
> map:database a d2rq:Database;
> d2rq:jdbcDriver "org.postgresql.Driver";
> d2rq:jdbcDSN "jdbc:postgresql://129.247.184.48/prototype";
> d2rq:username "wisdom";
> d2rq:password "wisdom.";
> .
> # Table core.dataset
> map:dataset a d2rq:ClassMap;
> d2rq:dataStorage map:database;
> d2rq:uriPattern "@@core.dataset.id@@";
> d2rq:class map:dataset;
> d2rq:classDefinitionLabel "core.dataset";
> .
> map:dataset_fk_provider a d2rq:PropertyBridge;
> d2rq:belongsToClassMap map:dataset;
> d2rq:property map:dataset_fk_provider;
> d2rq:refersToClassMap map:provider;
> d2rq:join "core.dataset.fk_provider => core.provider.id";
> .
> # Table core.provider
> map:provider a d2rq:ClassMap;
> d2rq:dataStorage map:database;
> d2rq:uriPattern "@@core.provider.id@@";
> d2rq:class map:provider;
> d2rq:classDefinitionLabel "core.provider";
> .
> I use PostgreSQL, jena ARQ 2.8.8, D2RQ 0.7.
>
> I would be grateful if you would further help me.
>
>
> --
> Trần Thái Bình
> GIS and Remote Sensing
> [email protected]
> [email protected]
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel