-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose RDFConverter building blocks to improve extensibility
This patch factors code from RdfConverter into a new AbstractRdfConverter base class. The advantage of that approach is that extending the RDF export becomes easier: you can create your own subclass of the AbstractRdfConverter but still reuse all the `writeXXXX` parts to perform the RDF generation for property/item documents and their parts. The current RdfConverter now makes use of that to provide the previous interface, where control of the parts to export is guided by a set of simple flags. Using AbstractRdfConverter, much more complex filtering can be implemented by extending the class, for example exporting terms only for some entities.
- Loading branch information
Showing
8 changed files
with
570 additions
and
498 deletions.
There are no files selected for viewing
420 changes: 420 additions & 0 deletions
420
wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/AbstractRdfConverter.java
Large diffs are not rendered by default.
Oops, something went wrong.
590 changes: 109 additions & 481 deletions
590
wdtk-rdf/src/main/java/org/wikidata/wdtk/rdf/RdfConverter.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
<http://localhost/entity/Q0> <http://www.wikidata.org/prop/P31> <http://www.wikidata.org/entity/statement/Q0-> . | ||
<http://www.wikidata.org/entity/statement/Q0-> a <http://wikiba.se/ontology#Statement> , <http://www.wikidata.org/prop/novalue/P31> ; | ||
<http://wikiba.se/ontology#rank> <http://wikiba.se/ontology#NormalRank> . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<http://www.wikidata.org/Q10Snone> <http://wikiba.se/ontology#rank> <http://wikiba.se/ontology#NormalRank> . | ||
|
||
<http://www.wikidata.org/Q10Snone> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://wikiba.se/ontology#BestRank> . |