简体   繁体   English

用于生成映射的D2RQ参数

[英]D2RQ parameters for generate-mapping

We are currently working on a project involving an "ordinary" relational database, but we wish to enable SPARQL requests towards this database. 我们目前正在开发涉及“普通”关系数据库的项目,但我们希望为此数据库启用SPARQL请求。

d2rq.org is a tool that enables SPARQL to be run towards the database with the help of a .ttl file which defines the database to RDF mapping. d2rq.org是一个工具,它可以在.ttl文件的帮助下运行SPARQL,该文件将数据库定义为RDF映射。

This .ttl file can be built automatically with a D2RQ tool named "generate-mapping". 可以使用名为“generate-mapping”的D2RQ工具自动构建此.ttl文件。 http://d2rq.org/generate-mapping takes quite a few arguments, some preceeded with a single dash "-" and some double "--". http://d2rq.org/generate-mapping需要一些参数,其中一些是一个短划线“ - ”和一些双“ - ”。 My challenge is that any argument preceeded with a double dash generates this error: 我的挑战是,任何带有双破折号的参数都会产生此错误:

Command: 命令:

./generate-mapping -u root -p password -o testmappingLocal.ttl --verbose jdbc:mysql:///iswc

Result: 结果:

Exception in thread "main" java.lang.IllegalArgumentException: Unknown argument: --verbose
    at jena.cmdline.CommandLine.handleUnrecognizedArg(CommandLine.java:215)
    at jena.cmdline.CommandLine.process(CommandLine.java:177)
    at d2rq.generate_mapping.main(generate_mapping.java:41)

Any help with the double-dash arguments will be greatly appreciated. 任何有关双破折号参数的帮助将不胜感激。 OS: Ubuntu Linux, D2RQ version: 0.8 操作系统:Ubuntu Linux,D2RQ版本:0.8

D2rq and mysql database using generate mapping file & rdf files. D2rq和mysql数据库使用生成映射文件和rdf文件。

1).mapping file generate commands: 1).mapping文件生成命令:

./generate-mapping -u root -p root -o /home/bigtapp/Documents/d2rqgenerate_mapping/mapfile.ttl jdbc:mysql://localhost:3306/d2rq ./generate-mapping -u root -p root -o /home/bigtapp/Documents/d2rqgenerate_mapping/mapfile.ttl jdbc:mysql:// localhost:3306 / d2rq

note: 1. root -p root -> mysql db username & password. 注意:1。root -p root - > mysql db username&password。 2. /home/bigtapp/Documents/d2rqgenerate_mapping/mapfile.ttl -> file save output path . 2. /home/bigtapp/Documents/d2rqgenerate_mapping/mapfile.ttl - >文件保存输出路径。 3.jdbc:mysql://localhost:3306 ->mysql driver. 3.jdbc:mysql:// localhost:3306 - > mysql驱动。 4./d2rq ->database name. 4./d2rq - >数据库名称。 2).the mapping file using RDF creation: 2)。使用RDF创建的映射文件:

use following command. 使用以下命令。

The RDF syntax to use for output. 用于输出的RDF语法。 Supported syntaxes are “TURTLE”, “RDF/XML”, “RDF/XML-ABBREV”, “N3”, and “N-TRIPLE” (the default). 支持的语法是“TURTLE”,“RDF / XML”,“RDF / XML-ABBREV”,“N3”和“N-TRIPLE”(默认值)。 “N-TRIPLE” works best for large databases. “N-TRIPLE”最适合大型数据库。 command: ./dump-rdf -f RDF/XML -b localhost:3306 -o /home/bigtapp/Documents/d2rqgenerate_mapping/dumpfile.rdf /home/bigtapp/Documents/d2rqgenerate_mapping/mapfile.ttl. 命令:./ dump -rdf -f RDF / XML -b localhost:3306 -o /home/bigtapp/Documents/d2rqgenerate_mapping/dumpfile.rdf /home/bigtapp/Documents/d2rqgenerate_mapping/mapfile.ttl。

apache-jena-fuseki create dataset then rdf file uploadserver then your using sparql query ..you get the result... apache-jena-fuseki创建数据集然后rdf文件uploadserver然后你使用sparql查询..你得到结果...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM