Hi Nouman, The Mapping class is not used for reading a mapping file.
What you want is something like this (not tested): String mappingURI = "file:/D:/D2R/d2rq-0.8/mapping-isis-1.n3" Model model = FileManager.get().loadModel(mappingURI); Mapping mapping = new MapParser(model, mappingURI).parse(); It's possible that you don't need to work with the Mapping class at all but that you can just use a ModelD2RQ or GraphD2RQ. (In case you haven't seen this yet, there are examples here: http://d2rq.org/jena ) Best, Richard On 19 Apr 2012, at 18:23, Nouman Fallouh wrote: > Hello .... > > I'm trying to load a D2R mapping file into my java code, so I'm trying to do > so: > > Mapping mapping = new Mapping("file:/D:/D2R/d2rq-0.8/mapping-isis-1.n3"); > > int i= mapping.databases().size(); > > but it returns i with the value 0, while the mapping file contains: > > ... > > map:ISIS_DB a d2rq:Database; > d2rq:jdbcDriver "com.mysql.jdbc.Driver"; > d2rq:jdbcDSN "jdbc:mysql://localhost:3306/svu_isis"; > d2rq:username "root"; > d2rq:password "mysql5.5"; > jdbc:autoReconnect "true"; > jdbc:zeroDateTimeBehavior "convertToNull"; > . > > ... > > it looks like the mapping instance has nothing in it ??? > > so I don't know what I'm missing, and where can I read about these things ?? > > any help is appreciated > > > best regards > > Naaman > > > > > > > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2_______________________________________________ > d2rq-map-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 _______________________________________________ d2rq-map-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
