https://github.com/ubleipzig/rdfxml-ingest
https://github.com/ubleipzig/rdfxml-ingest
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ubleipzig/rdfxml-ingest
- Owner: ubleipzig
- License: apache-2.0
- Created: 2017-06-27T10:32:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-28T14:30:38.000Z (almost 9 years ago)
- Last Synced: 2025-06-18T06:35:30.357Z (12 months ago)
- Language: Java
- Size: 2.53 MB
- Stars: 0
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
RDFXML INGEST
===================================
A CLI tool that reads an XML file source, transforms it to RDF/XML with XSLT, and PUTs the result into a Fedora Repository.
### USAGE
$ gradle installDist
$ cd ./ingester-core/build/install/ingester-core/bin
$ ./ingester-core -r {$filesytem path to XML source file} -x {$filesytem path to transformation xslt} -d {$output dir for transformed file} -b {$base URI of repository}
example:
$ ./ingester-core -r ~/IdeaProjects/rdfxml-ingest/ingester-core/src/main/resources/import-data/metsmods.xml -x ~/IdeaProjects/rdfxml-ingest/ingester-core/src/main/resources/cool.pandora.ingester/oaimets2rdf.xsl -d /tmp/output-data -b http://localhost:8080/fcrepo/rest
The resource identifier is extracted from the XML source and appended onto the repository base URI.
### SPARQL
The intent of this tool is to facilitate mutation of legacy XML datasets with SPARQL. Here is an example.
```sparql
PREFIX rdf:
CONSTRUCT { ?manifest ?fLocat .
?fLocat ?divOrder .
?fLocat ?title .
?fLocat rdf:type ?type .
}
WHERE {values ?manifest {} .
?manifest ?fileGrp .
?fileGrp ?file .
?file ?fileID .
?file ?fLocat .
?file ?divOrder .
?file ?logDivId .
?logDivId ?title .
?logDivId rdf:type ?type .
}
```
This can produce JSON-LD nodes that look like this:
```json
{
"@id" : "http://digital.slub-dresden.de/fileadmin/data/263566811/263566811_tif/jpegs/00000001.tif.medium.jpg",
"@type" : "http://www.loc.gov/METS/structMap#monograph",
"hasPhysDivOrder" : "1",
"v3title" : "Der furnembsten, notwendigsten, der gantzen Architectur angehoerigen Mathematischen und Mechanischen kuenst eygentlicher bericht und vast klare, verstendliche unterrichtung"
}
```
Also, in conjunction with the fedora-import-export utility, resources can be round-tripped in the BagIt format.
* See [output bag example](https://github.com/ubleipzig/rdfxml-ingest/tree/master/ingester-core/src/main/resources/output-data/example_bag)
For a easy to setup test Fedora API-X implementation, see [APIX-OAI](https://github.com/pan-dora/apix-oai)