Finally built raptor2.0.8 and rasqal0.9.29 libraries on win 7 using Mingw toolset


Steps:

1) install mingw and msys environment;

2) get a pkg-config tool, use one ship with graphviz(install graphviz win version and under its bin dir), it works;

3) for msys shell, vim /etc/profile , add below to let pkg-config can find raptor after it installed, or rasqal can’t configure;

export PKG_CONFIG_PATH=”/usr/local/lib/pkgconfig”

4) in msys shell, cd raptor dir and ./configure; make install;

note: some error occurs when build rapper.exe, and dll build not successful.

5) cd rasqal dir and ./configure;

6) need to add this to rasqal_config.h, to let rasqal use statically linked version of raptor functions;

#define RAPTOR_STATIC

7) need to tweak win32_rasqal_config.h,

add #include <stdint.h> near <windows.h> for those int16_t etc declarations;

comment out #define round definition, which will conflict with some window definition.

8) ./configure; make install.


 done.

A short memo note about Turtle format

The , symbol may be used to repeat the subject and predicate of triples that only differ in the object RDF term.
The ; symbol may be used to repeat the subject of triples that vary only in predicate and object RDF terms.
An RDF Collection may be abbreviated using a sequence of RDF Terms enclosed in ( ) brackets.
[] can used to say something without naming it.
@base a @base b is used with to produce ; @prefix a is used with a:c to produce

D2RQ Java Source Files List in Size Descending Order

use this command in D2RQ Dir

find . -type f -name “*.java” -exec ls -l {} \;| sort -n -r -k6

and get the list below:
42201 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/optimizer/D2RQTreeOptimizer.java
38501 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/TransformExprToSQLApplyer.java
26329 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/sql/ConnectedDB.java
22393 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/mapgen/MappingGenerator.java
22371 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/parser/MapParser.java
18312 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/vocab/D2RQ.java
18033 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/vocab/ISWC.java
15988 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/dbschema/DatabaseSchemaInspector.java
15584 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/optimizer/transformer/TransformPrepareOpTreeForOptimizing.java
13755 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/values/PatternTest.java
13702 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/transformer/TransformD2RQ.java
12929 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/vocab/FOAF.java
12897 Mar 10 19:25 ./test/de/fuberlin/wiwiss/d2rq/optimizer/ExprTransformTest2.java
12825 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/nodes/NodeSetTest.java
12570 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/sql/ResultRowMap.java
12540 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/map/ResourceMap.java
12232 Mar 10 19:26 ./src/de/fuberlin/wiwiss/d2rq/engine/TripleRelationJoiner.java
10253 Mar 15 14:14 ./src/d2rq/dump_rdf.java
9969 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/helpers/QueryLanguageTestFramework.java
9588 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/SQL.java
9583 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/d2rq_sdb/SdbSqlEqualityTest.java
9404 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/values/Pattern.java
9183 Mar 15 14:14 ./test/de/fuberlin/wiwiss/d2rq/sql/MySQLDatatypeTest.java
8781 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/iterators/RelationToBindingsD2RQIterator.java
8759 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/map/Mapping.java
8645 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/nodes/NodeSetFilterImpl.java
8178 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/GraphD2RQ.java
7837 Mar 15 14:14 ./test/de/fuberlin/wiwiss/d2rq/sql/HSQLDBDatatypeTest.java
7773 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/D2RServer.java
7666 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/vocab/SKOS.java
7647 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/map/PropertyBridge.java
7362 Mar 10 19:26 ./src/de/fuberlin/wiwiss/d2rq/nodes/TypedNodeMaker.java
7313 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/sql/SQLSyntaxTest.java
7286 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/PageServlet.java
7283 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/map/TranslationTable.java
7217 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/functional_tests/FindTest.java
7211 Mar 10 19:25 ./test/de/fuberlin/wiwiss/d2rq/engine/GraphPatternTranslatorTest.java
7148 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/find/URIMakerRuleTest.java
7146 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/algebra/AttributeTest.java
7127 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/transformer/TransformAddFilters.java
6781 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/d2rq_sdb/LoadDataTest.java
6603 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/algebra/AliasMapTest.java
6601 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/MetadataCreator.java
6098 Mar 2 11:49 ./src/de/fuberlin/wiwiss/pubby/negotiation/MediaRangeSpec.java
5954 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/functional_tests/SPARQLTest.java
5842 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/D2RQException.java
5780 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/DBConnectionTest.java
5703 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/Relation.java
5468 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/map/Database.java
5461 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/TripleRelation.java
5440 Mar 10 19:25 ./test/de/fuberlin/wiwiss/d2rq/parser/ParserTest.java
5363 Mar 2 11:49 ./src/de/fuberlin/wiwiss/pubby/negotiation/ContentTypeNegotiator.java
5327 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/SelectStatementBuilder.java
5228 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/server/AutoReloadableDataset.java
5219 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/ConfigLoader.java
5198 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/AliasMap.java
5142 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/JoinOptimizer.java
5128 Mar 15 14:14 ./test/de/fuberlin/wiwiss/d2rq/sql/DatatypeTestBase.java
5034 Mar 15 14:14 ./src/d2rq/generate_mapping.java
5031 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/find/URIMakerRule.java
5018 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/CompatibleRelationGroup.java
4918 Mar 15 14:14 ./test/de/fuberlin/wiwiss/d2rq/helpers/HSQLDatabase.java
4903 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/transformer/TransformApplyD2RQOpimizingRules.java
4766 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/sql/SQLBuildingTest.java
4676 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/map/CompileTest.java
4455 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/RelationImpl.java
4414 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/Join.java
4304 Mar 10 19:25 ./src/de/fuberlin/wiwiss/d2rq/map/DownloadMap.java
4242 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/parser/RelationBuilder.java
4186 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/values/BlankNodeID.java
4182 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/ModelResponse.java
4079 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/map/ClassMap.java
4059 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/DeMorganLawApplyer.java
4048 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/sql/QueryExecutionIterator.java
4046 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/DistributiveLawApplyer.java
4044 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/RelationName.java
4011 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/engine/GraphPatternTranslator.java
3980 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/Attribute.java
3978 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/find/FindQuery.java
3761 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/ResourceServlet.java
3752 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/RequestParamHandler.java
3682 Mar 10 19:26 ./src/de/fuberlin/wiwiss/d2rq/download/DownloadContentQuery.java
3626 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/SQLSyntax.java
3616 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/pp/PrettyPrinterTest.java
3579 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/optimizer/ExprTransformTest.java
3573 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/VelocityWrapper.java
3546 Mar 10 19:26 ./src/de/fuberlin/wiwiss/d2rq/find/RelationToTriplesIterator.java
3440 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/engine/QueryEngineD2RQ.java
3429 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Conjunction.java
3427 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Disjunction.java
3386 Mar 10 19:25 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/XSD.java
3379 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/values/ValueMakerTest.java
3334 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/engine/NamesToNodeMakersMap.java
3328 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/ResourceDescriptionServlet.java
3319 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/map/MappingTest.java
3298 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/BeanCounter.java
3295 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/algebra/JoinTest.java
3288 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/OpFilterUtility.java
3247 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/values/ValueDecorator.java
3236 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/JettyLauncher.java
3182 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/csv/CSV.java
3145 Mar 15 14:14 ./test/de/fuberlin/wiwiss/d2rq/helpers/HSQLSimpleTest.java
3118 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/engine/NodeRelation.java
2954 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/download/DownloadContentQueryTest.java
2905 Mar 10 19:26 ./test/de/fuberlin/wiwiss/d2rq/expr/ExpressionTest.java
2861 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/vocab/D2RConfig.java
2823 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/FindDescribeHandler.java
2695 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/ModelD2RQ.java
2684 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/SQL92Syntax.java
2638 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Equality.java
2632 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/algebra/ColumnRenamerTest.java
2632 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/ColumnRenamer.java
2631 Mar 10 19:26 ./src/de/fuberlin/wiwiss/d2rq/expr/Constant.java
2619 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/expr/ConjunctionTest.java
2611 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/map/TranslationTableTest.java
2587 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/D2RQQueryHandler.java
2561 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/nodes/DetermineNodeType.java
2561 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Concatenation.java
2554 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/engine/NodeRelationJoiner.java
2545 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/expr/SQLExpressionTest.java
2523 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/ClassMapServlet.java
2502 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/map/ConstantValueClassMapTest.java
2484 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/pp/PrettyPrinter.java
2476 Mar 2 11:49 ./src/d2rq/server.java
2466 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/DirectoryServlet.java
2449 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/nodes/NodeMakerTest.java
2388 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/sql/SQLScriptLoader.java
2356 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/nodes/NodeSetFilter.java
2289 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/helpers/FindTestFramework.java
2267 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/values/Translator.java
2264 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/SPARQLToSQLOperatorsTable.java
2257 Mar 2 11:49 ./src/de/fuberlin/wiwiss/pubby/negotiation/PubbyNegotiator.java
2226 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/engine/BindingMaker.java
2193 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/engine/OpD2RQ.java
2092 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/algebra/TripleRelationTest.java
2089 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/csv/TranslationTableParser.java
2065 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/MutableRelation.java
1978 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/csv/TranslationTableParserTest.java
1970 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/SQLExpression.java
1963 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/WebappInitListener.java
1954 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/values/ValueMaker.java
1891 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/vocab/VocabularySummarizer.java
1815 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/D2RQTestSuite.java
1814 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Expression.java
1809 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/functional_tests/ModelAPITest.java
1756 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/values/SQLExpressionValueMaker.java
1632 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/RelationalOperators.java
1609 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/engine/MapFixture.java
1560 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/assembler/D2RQAssembler.java
1544 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/CachingGraphD2RQ.java
1505 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/algebra/CompatibleRelationGroupTest.java
1442 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/BinaryOperator.java
1427 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/map/MapObject.java
1416 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/AttributeNotNull.java
1392 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/ColumnRenamerMap.java
1384 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/values/Column.java
1372 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/RootServlet.java
1332 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/nodes/NodeMaker.java
1298 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/nodes/FixedNodeMaker.java
1263 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/transformer/TransformRemoveEmptyUnion.java
1253 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/MySQLSyntax.java
1247 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/NamespaceServlet.java
1238 Mar 15 14:14 ./src/de/fuberlin/wiwiss/d2rq/dbschema/ColumnType.java
1236 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/values/DummyValueSource.java
1216 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/examples/JenaModelExample.java
1200 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/AttributeExpr.java
1193 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/sql/ResultRowTest.java
1189 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/ExpressionProjectionSpec.java
1132 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/expr/ConcatenationTest.java
1117 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/find/TripleMaker.java
1103 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/map/Configuration.java
1080 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/examples/SPARQLExample.java
1074 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/examples/JenaGraphExample.java
1069 Mar 10 19:26 ./test/de/fuberlin/wiwiss/d2rq/sql/DummyDB.java
1052 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/server/D2RQDatasetDesc.java
1044 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/ops/OpFilteredBGP.java
1021 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/algebra/RelationTest.java
1013 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Negation.java
1009 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/functional_tests/AllTests.java
957 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/vocab/JDBC.java
942 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/ExprUtility.java
937 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/helpers/MappingHelper.java
919 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/dbschema/ISWCSchemaTest.java
874 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/UnaryMinus.java
792 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/JenaAPITest.java
788 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/parser/URITest.java
768 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Multiply.java
768 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/D2RQCapabilities.java
714 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/d2rq_sdb/AllTests.java
714 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Add.java
673 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/examples/AssemblerExample.java
652 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/OracleSyntax.java
636 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/ConstantEx.java
626 Mar 10 19:25 ./src/de/fuberlin/wiwiss/d2rq/map/DynamicProperty.java
618 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/algebra/AllTests.java
580 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/optimizer/utility/AttributeExprEx.java
566 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/map/AllTests.java
563 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/algebra/ProjectionSpec.java
530 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/engine/D2RQDatasetGraph.java
527 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/MSSQLSyntax.java
514 Mar 15 14:14 ./test/de/fuberlin/wiwiss/d2rq/sql/AllTests.java
473 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/expr/AllTests.java
463 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/sql/ResultRow.java
451 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/AllTests.java
435 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/GreaterThanOrEqual.java
426 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/LessThanOrEqual.java
413 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/GreaterThan.java
405 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Subtract.java
403 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/LessThan.java
400 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/vocab/Test.java
398 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/expr/Divide.java
384 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/values/AllTests.java
381 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/nodes/AllTests.java
355 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/engine/AllTests.java
347 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/dbschema/AllTests.java
344 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/csv/AllTests.java
339 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/parser/AllTests.java
336 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/find/AllTests.java
333 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/pp/AllTests.java
333 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/download/AllTests.java
327 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/optimizer/AllTests.java
322 Mar 2 11:49 ./test/de/fuberlin/wiwiss/d2rq/helpers/AllTests.java
296 Mar 2 11:49 ./src/de/fuberlin/wiwiss/d2rq/vocab/META.java
206 Mar 10 19:26 ./src/de/fuberlin/wiwiss/d2rq/sql/SQLDataType.java

Try ViziQuer SPARQL client tool

ViziQuer is a SPARQL client GUI tool, which explores SPARQL endpoint data schema and help user construct simple graphical queries to retrieve data. Below is a tutorial on how to use it.

Get Metadata from SPARQL end point

Make a new project, enter a sparql endpoint uri, here I put http://api.talis.com/stores/space/services/sparql , and after about 3 minutes of freezed waiting, below shows up:

 

Figure 1 VisiQuer ontology view of talis space sparql endpoint

Now, create a query using the Query form, the class listbox can assit user to select from all the classes just got from the SPARQL endpoint.

Figure 2 VisiQuer class select list control

Give result data another name

If data should be renamed to fit with data consumer’s request, it can be done here in the query constructon process.

Click Attribute in answer, and the dialog below shows up to let user input what should be renamed to what.

 

Add a data filter

Data filter is a filter using an object’s data property. Here we use name property’s value must be “Apollo 9” to filter records.

Get answer from SPARQL endpoint to the query just constructed

 

the sparql query string generated is:

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#&gt;

select distinct ?name

where

{?t0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; <http://purl.org/net/schemas/space/Spacecraft&gt;.

?t0 <http://xmlns.com/foaf/0.1/name&gt; ?a0.

FILTER (

?a0=xsd:string(“Apollo 9”)

).

OPTIONAL {?t0 <http://xmlns.com/foaf/0.1/name&gt; ?name. }

}

The result got is:

<?xml version=”1.0″?>

<sparql xmlns=”http://www.w3.org/2005/sparql-results#”&gt;

<head>

<variable name=”name”/>

</head>

<results>

<result>

<binding name=”name”>

<literal>Apollo 9</literal>

</binding>

</result>

</results>

</sparql>

 

 

Add a relation filter

According to the manual of ViziQuer, the add link tool can be drag from one class to another class on the graph, but whenever I draw the link between two classes on form, the viziQuer will down, and a tda.exe error message throw out. Maybe this is because there is no relationship in the talis space sparql endpoint’s data source, see Figure 1.

Try the test case shipped with ViziQuer(open project-> testDogFood).

Open the query edit form, and use the link button to drag from “Person” rounded rectangle to “InProceedings” one.

A “Choose Path” titled window will appear. The window is loaded with radio buttons for all possible paths from “Person” class to “InProceeding” class.

But when we want to get answer from right click on Person and choose “get answer”, a JNI error occurred.

Problems of ViziQuer

Though ViziQuer implements a prototype of SPARQL Client GUI Tool, but it has some problems:

  • Source code not available;
  • Not pure Java code;
  • Data schema is in some uncommon format;
  • Easy to crash.

To update my project MAVEN dependencies due to D2RQ0.8 update

D2RQ0.8 launched this week, it takes nearly 3 years to upgrade from last version 0.7 which was released 2009-08-10. And this time, the full D2RQ source code is opened, not only the D2RQ server part code. A big Belgium company called DERI seems to sponsor the D2RQ team to go on their development, which is also good for me to have my project developing on a steady base.

This is a note of my project setup change due to upgrade of D2RQ0.8.

According to D2RQ0.8’s release note, it upgrades core libraries: ARQ 2.9, Jena 2.7, Joseki 3.4.4, Jetty 8.1.1 and upgrades other libraries: Velocity 1.7, SLF4J 1.6.4, log4j 1.2.16, HSQLDB 2.8.8. What I care about is the D2RQ core, ARQ, Jena and Mysql Driver upgrades.

Install D2RQ0.8 and Mysql JDBC5.1.8 Driver as local maven repository entry

Since I am using maven to manage my project dependencies, and D2RQ is not in a known global maven repository, I need to install D2RQ0.8 lib into my local maven repository by hand. Below is the command:

mvn install:install-file -Dfile=d2rq-0.8.jar -DgroupId=d2rq -DartifactId=d2rq -Dversion=0.8 -Dpackaging=jar -DlocalRepositoryPath=c:\Users\semwebguy\.m2\repository

mvn install:install-file -Dfile=mysql-connector-java-5.1.18-bin.jar -DgroupId=JDBCDriver -DartifactId=mysql-driver -Dversion=5.1.8 -Dpackaging=jar -DlocalRepositoryPath=c:\Users\semwebguy\.m2\repository

Update Maven pom.xml

Thanks to Apache foundation, the upgrade of Jena dependencies using maven is really easy.

Put XML element below in pom.xml and remove their previous version counterpart:

        <dependency>

            <groupId>JDBCDriver</groupId>

            <artifactId>mysql-driver</artifactId>

            <version>5.1.8</version>

        </dependency>

        <dependency>

            <groupId>d2rq</groupId>

            <artifactId>d2rq</artifactId>

            <version>0.8</version>

        </dependency>

        <dependency>

            <groupId>org.apache.jena</groupId>

            <artifactId>jena-arq</artifactId>

            <version>2.9.0-incubating</version>

        </dependency>

        <dependency>

            <groupId>org.apache.jena</groupId>

            <artifactId>apache-jena</artifactId>

            <version>2.7.0-incubating</version>

            <type>pom</type>

        </dependency>

Some client source code change needed

As to time of writing, I just found code change below is needed.

        ConnectedDB db = new ConnectedDB(jdbcuri, user, pwd);

        ConnectedDB.registerJDBCDriver(“com.mysql.jdbc.Driver”);

        MappingGenerator mg = new MappingGenerator(db);

        model = mg.mappingModel(null, System.err);

Here MappingGenerator no long accept string triple to construct, instead, a new ConnectedDB object is in need, which is a clear and better design.

Quick Steps to make your java program as a restful service on tomcat

Technique choices:

  • Avoid using XML or spring frameworks, plain JSON string is enough for
    defining data format. At server side, you can use json-simple framework, no
    additional classes envolved as types for data format, those classes make your
    program messy;
  • Use maven to manage your dependency on other libs , it will save your time to
    download and copy third party libaries again and again ;
  • ApacheCXF as framework, its community is active and it supports JAX-RI.

Steps:

  1. Maven command to make a service skeleton folder with everything you need inside and
    modifiable.

    $Any > mvn archetype:generate DgroupId=$A DartifactId=$B  DarchetypeArtifactId=mavenarchetypewebapp

    now, you get a complete webapp template folder as $Any/$B.

  2. Modify the $Any/$B/pom.xml file, add Apache CXF dependency, and any third party
    dependency you want.

    <project xmlns=http://maven.apache.org/POM/4.0.0 xmlns:xsi=http://www.w3.org/2001/XMLSchemainstance 
      xsi:schemaLocation=http://maven.apache.org/POM/4.0.0http://maven.apache.org/mavenv4_0_0.xsd> 
      <modelVersion>4.0.0</modelVersion> 
      <groupId>$A</groupId> 
      <artifactId>$B</artifactId> 
      <packaging>war</packaging> 
      <version>0.5</version> 
      <name>Maven Webapp</name> 
      <url>http://maven.apache.org</url> 
      <dependencies> 
        <dependency> 
          <groupId>junit</groupId> 
          <artifactId>junit</artifactId> 
          <version>3.8.1</version> 
          <scope>test</scope> 
        </dependency> 
     <dependency> 
        <groupId>com.googlecode.jsonsimple</groupId> 
        <artifactId>jsonsimple</artifactId> 
        <version>1.1</version> 
    </dependency> 
      <dependency> 
       <groupId>org.apache.cxf</groupId> 
       <artifactId>apachecxf</artifactId> 
       <version>2.3.1</version> 
       <type>pom</type> 
       <scope>compile</scope> 
      </dependency> 
    </dependencies> 
     <repositories> 
     </repositories> 
      <build> 
        <finalName>$B</finalName> 
      </build> 
    </project>

  3. Write your Java restful resource class. Such as:
    package $P 
    @Path($C) public class $H { 
    @POST @Produces(application/json) 
    @Path(/$D/) 
    public String yourMethod(String msg) { 
    ……….. } 
    }

  4. put your java files into $B\src\main\java ; and put your web pages into
    $B\src\main\webapp .
  5. Edit the $B\src\main\webapp\WEB-INF\web.xml, to tell tomcat those info,
    including the servlet and url to your java program, and url to your web pages,

     <?xml version=1.0 encoding=UTF8?> 
    <webapp version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee> 
      <displayname></displayname> 
      <welcomefilelist> 
    <welcomefile>$E</welcomefile> 
    </welcomefilelist> 
      <servlet> 
        <servletname>$F</servletname> 
        <servletclass> 
    org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet </servletclass> 
        <initparam> 
          <paramname>jaxrs.serviceClasses</paramname> 
          <paramvalue>$P.$H</paramvalue> 
        </initparam> 
      </servlet> 
      <servletmapping> 
        <servletname>$F</servletname> 
        <urlpattern>$G</urlpattern> 
      </servletmapping> 
    </webapp>

    note that, $G is very important here, since client JavaScript programmers using your
    serivce should send their HTTP Request to $G/$C/$D to access your service. The $G
    here functions as a switch between pages access and service access. If $G is “/*”,
    then $E can’t be visited, since all request to the webapp are switched to the
    servlet.

  6. cd into $B, run
    $B> mvn clean package

    you will find $B.war under $B/target/

to quickly set up a trunk , tags, branches repository

1) first create a repository , use right click – create repos here;
2) then go to any other place than repo, make a folder X holds tags, trunk and branches, on X right click – import , the url is to the repo just created;

WSMO, WSML, WSMX , the european version of semantic web service

The relationship between WSMO & WSML is similar to OWL-S & OWL.WSMX is an execution environment for WSMO annotated services.

Web Service Modeling Ontology(WSMO) is a conceptual model for relevant aspects related to Semantic Web Services. It provides an ontology based framework, which supports the deployment and interoperability of Semantic Web Services.

The WSMO has four main components:

• Goals – The client’s objectives when consulting a Web Service.

• Ontologies – A formal Semantic description of the information used by all other components.

• Mediators – Connectors between componentes with mediation facilities. Provides interoperability between different ontologies.

• WebServices – Semantic description of Web Services. May include functional (Capability) and usage (Interface) descriptions.

The WSMO working group, part of the ESSI Cluster aligns the research and development efforts in the areas of Semantic Web Services between several European FP6 research projects.

WSMO working group includes the WSML working group, which aims at developing a language called Web Service Modeling Language (WSML) that formalizes the Web Service Modeling Ontology (WSMO).

WSML is a language for modeling Web services, ontologies, and related aspects, and is based on the Web Service Modeling Ontology WSMO. The formal grounding of the language is based on a number of logical formalisms, namely, Description Logics, First-Order Logic and Logic Programming. Besides providing its own language for modeling ontologies, it allows the import and use of RDF Schema and OWL ontologies for Web service description.

how to add a local jar as a local maven dependency in eclipse using m2eclipse

Only three steps:

1) run Cmd , using apache maven binary(not the m2eclipse plugin)

mvn install:install-file -Dfile=path-to-your-artifact-jar \
-DgroupId=your.groupId \
-DartifactId=your-artifactId \
-Dversion=version \
-Dpackaging=jar \
-DlocalRepositoryPath=path-to-specific-local-repo

2) In eclipse, window-> show view->maven repository->local repository->rebuilt-index

3) In eclipse, add dependency using m2eclipse plugin, and you can find the local jar through the GUI as a dependency just like from public maven Repos.

How to extend Pellet2.2.2’s SWRL rule support with your custom built-in ?

Broadly, there are 3 steps:

1. create your built-in class ;

2. register it to pellet;

3. use your built-in in your rule;

0) set up your environment the  maven way

add dependency and repository to your pom.xml as listed below:

<dependency>
<groupId>com.owldl</groupId>
<artifactId>pellet</artifactId>
<version>2.2.2</version>
<scope>runtime</scope>
</dependency>
<repository>
<id>on.cs.unibas.ch</id>
<name>DBIS Maven Releases Repository</name>
<url>http://on.cs.unibas.ch/maven/repository</url&gt;
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>

1) create your built-in class:

package cbob.builtin;
import static org.mindswap.pellet.utils.Namespaces.XSD;
import com.clarkparsia.pellet.rules.builtins.GeneralFunction;
import aterm.ATermAppl;
import org.mindswap.pellet.ABox;
import org.mindswap.pellet.Literal;
import org.mindswap.pellet.utils.ATermUtils;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class MoreDateTimeOperators {

private static class Today implements GeneralFunction {
static Log lg = LogFactory.getLog(Today.class);
public boolean apply(ABox abox, Literal[] args) {
lg.debug(“here we are in custom builtIn”);
Calendar calendar = Calendar.getInstance();
SimpleDateFormat isoFormat = new SimpleDateFormat(“yyyy-MM-dd”);
ATermAppl tt = ATermUtils.makeTypedLiteral(isoFormat.format(calendar.getTime())
, XSD+”date”);
Literal result = abox.addLiteral(tt);
if ( result != null ) {
if ( args[0] == null )
args[0] = result;
return true;
}
return false;
}

public boolean isApplicable(boolean[] boundPositions) {
return true;
}
}
public final static GeneralFunction today = new Today();
}

2) register your built-in to pellet

The code below should be inserted anywhere before loading pellet.

BuiltInRegistry.instance.registerBuiltIn( “urn:cbob:builtIn#today“, new GeneralFunctionBuiltIn( MoreDateTimeOperators.today ) );

3) Use your built-in in your ontology(Manchester Syntax)

Prefix: xsd: <http://www.w3.org/2001/XMLSchema#&gt;
Prefix: owl: <http://www.w3.org/2002/07/owl#&gt;
Prefix: : <urn:cbob:event#>
Prefix: xml: <http://www.w3.org/XML/1998/namespace&gt;
Prefix: rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
Prefix: rdfs: <http://www.w3.org/2000/01/rdf-schema#&gt;
Prefix: skos: <http://www.w3.org/2004/02/skos/core#&gt;

Ontology: <urn:cbob:event>

Class: RelativeTime

Individual: today

Types:
RelativeTime

DataProperty: hasDate

SubPropertyOf:
owl:topDataProperty

Rule:
RelativeTime(today), <urn:cbob:builtIn#today>(?<t>) -> hasDate(today, ?<t>)

3+) you can load this ontology and now pellet can answer “what date is today?” in SPARQL,

PREFIX : <urn:cbob:event#>

SELECT ?when WHERE { today hasDate ?when}