|
| 1 | +# Linked Data Fragments Server - RDFa Datasource |
| 2 | +<img src="http://linkeddatafragments.org/images/logo.svg" width="200" align="right" alt="" /> |
| 3 | + |
| 4 | +[](https://www.npmjs.com/package/@ldf/datasource-rdfa) |
| 5 | + |
| 6 | +This module contains a RDFa datasource for the [Linked Data Fragments server](https://github.com/LinkedDataFragments/Server.js). |
| 7 | +It allows HTML files containing RDFa to be loaded. |
| 8 | + |
| 9 | +_This package is a [Linked Data Fragments Server module](https://github.com/LinkedDataFragments/Server.js/)._ |
| 10 | + |
| 11 | +## Usage in `@ldf/server` |
| 12 | + |
| 13 | +This package exposes the following config entries: |
| 14 | +* `RdfaDatasource`: A RDFa datasource that requires at least one `file` field. _Should be used as `@type` value._ |
| 15 | + |
| 16 | +Example: |
| 17 | +```json |
| 18 | +{ |
| 19 | + "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@ldf/server/^3.0.0/components/context.jsonld", |
| 20 | + "@id": "urn:ldf-server:my", |
| 21 | + "import": "preset-qpf:config-defaults.json", |
| 22 | + |
| 23 | + "datasources": [ |
| 24 | + { |
| 25 | + "@id": "urn:ldf-server:myRdfaDatasource", |
| 26 | + "@type": "RdfaDatasource", |
| 27 | + "datasourceTitle": "My RDFa HTML file", |
| 28 | + "description": "My dataset with a RDFa back-end", |
| 29 | + "datasourcePath": "myrdfa", |
| 30 | + "file": "path/to/file.html" |
| 31 | + } |
| 32 | + ] |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +## Usage in other packages |
| 37 | + |
| 38 | +When this module is used in a package other than `@ldf/server`, |
| 39 | +then the JSON-LD context `https://linkedsoftwaredependencies.org/contexts/@ldf/datasource-rdfa.jsonld` must be imported. |
| 40 | + |
| 41 | +For example: |
| 42 | +``` |
| 43 | +{ |
| 44 | + "@context": [ |
| 45 | + "https://linkedsoftwaredependencies.org/bundles/npm/@ldf/core/^3.0.0/components/context.jsonld", |
| 46 | + "https://linkedsoftwaredependencies.org/bundles/npm/@ldf/preset-qpf/^3.0.0/components/context.jsonld", |
| 47 | + "https://linkedsoftwaredependencies.org/bundles/npm/@ldf/datasource-rdfa/^3.0.0/components/context.jsonld", |
| 48 | + ], |
| 49 | + // Same as above... |
| 50 | +} |
| 51 | +``` |
| 52 | + |
| 53 | +## License |
| 54 | +The Linked Data Fragments server is written by [Ruben Verborgh](https://ruben.verborgh.org/), Miel Vander Sande, [Ruben Taelman](https://www.rubensworks.net/) and colleagues. |
| 55 | + |
| 56 | +This code is copyrighted by [Ghent University – imec](http://idlab.ugent.be/) |
| 57 | +and released under the [MIT license](http://opensource.org/licenses/MIT). |
0 commit comments