All Projects → metadataframes → basex-rdf

metadataframes / basex-rdf

Licence: GPL-3.0 license
RDF parsing for BaseX

Programming Languages

java
68154 projects - #9 most used programming language
XSLT
1337 projects
XQuery
69 projects

Projects that are alternatives of or similar to basex-rdf

rio
RDF parsers library
Stars: ✭ 56 (+250%)
Mutual labels:  rdf, turtle, n-triples
Rdflib
RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.
Stars: ✭ 1,584 (+9800%)
Mutual labels:  linked-data, rdf, turtle
joseki
Pure Go library for working with RDF, a powerful framework for representing informations as graphs.
Stars: ✭ 27 (+68.75%)
Mutual labels:  rdf, turtle, n-triples
Hypergraphql
GraphQL interface for querying and serving linked data on the Web.
Stars: ✭ 112 (+600%)
Mutual labels:  linked-data, rdf
Hypergraphql
GraphQL interface for querying and serving linked data on the Web.
Stars: ✭ 120 (+650%)
Mutual labels:  linked-data, rdf
Rdf Dereference.js
Dereference any URL for its RDF contents
Stars: ✭ 18 (+12.5%)
Mutual labels:  linked-data, rdf
Semanticmediawiki
🔗 Semantic MediaWiki turns MediaWiki into a knowledge management platform with query and export capabilities
Stars: ✭ 359 (+2143.75%)
Mutual labels:  linked-data, rdf
Ckanext Dcat
CKAN ♥ DCAT
Stars: ✭ 107 (+568.75%)
Mutual labels:  linked-data, rdf
Informationmodel
The Information Model of the International Data Spaces implements the IDS reference architecture as an extensible, machine readable and technology independent data model.
Stars: ✭ 27 (+68.75%)
Mutual labels:  linked-data, rdf
Grafter
Linked Data & RDF Manufacturing Tools in Clojure
Stars: ✭ 174 (+987.5%)
Mutual labels:  linked-data, rdf
Rdf Ext
RDF library for NodeJS and the Browsers
Stars: ✭ 97 (+506.25%)
Mutual labels:  linked-data, rdf
Rdf4j
Eclipse RDF4J: scalable RDF for Java
Stars: ✭ 242 (+1412.5%)
Mutual labels:  linked-data, rdf
Dokieli
💡 dokieli is a clientside editor for decentralised article publishing, annotations and social interactions
Stars: ✭ 582 (+3537.5%)
Mutual labels:  linked-data, rdf
Community Server
Community Solid Server: an open and modular implementation of the Solid specifications
Stars: ✭ 117 (+631.25%)
Mutual labels:  linked-data, rdf
Pyld
JSON-LD processor written in Python
Stars: ✭ 413 (+2481.25%)
Mutual labels:  linked-data, rdf
Jsonld.js
A JSON-LD Processor and API implementation in JavaScript
Stars: ✭ 1,212 (+7475%)
Mutual labels:  linked-data, rdf
Limes
Link Discovery Framework for Metric Spaces.
Stars: ✭ 94 (+487.5%)
Mutual labels:  linked-data, rdf
Nspm
🤖 Neural SPARQL Machines for Knowledge Graph Question Answering.
Stars: ✭ 156 (+875%)
Mutual labels:  linked-data, rdf
Tropy
Research photo management
Stars: ✭ 337 (+2006.25%)
Mutual labels:  linked-data, rdf
Rdf
RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data.
Stars: ✭ 353 (+2106.25%)
Mutual labels:  linked-data, rdf

basex-rdf

RDF parsing for XQuery (in BaseX)

Table of Contents

Overview and status

This is an extension module for parsing RDF data with the BaseX XQuery processor. It provides an XQuery wrapper for a Java parser generated by Gunther Rademacher's REx Parser Generator. The parser was generated from the EBNF for the TriG serialization of RDF, which provides a syntax for encoding named graphs, as an extension of the Turtle and N-Triples serializations. The parser itself will generate XML parse trees for any of these three serializations. However, the raw parse trees are not particularly useful and need to be normalized before being further processed and queried. Internally, the normalization stylesheet maps Turtle, N-Triples, and TriG to a common XML serialization format.

Modeling and schema design possibilities for the normalized XML representation of the parsed RDF data are still under consideration, and current approaches are subject to change.

Dependencies

Packaging

  • By default, the BaseX 9.0 combined packaging feature is used. This (beta) feature optimizes the packaging of Java extension code in BaseX.
  • Alternative packages, such as the EXPath packaging model, may be added in the future (although the package would still be dependent on BaseX).

Installation

See the BaseX wiki for detailed documentation about installing and using BaseX.

  • Once BaseX has been downloaded, the easiest way to add the basex-rdf module is by launching the BaseX GUI. From the Options menu, select Packages and install the Graphs.jar file from the repo directory of the basex-rdf repository.
  • Before executing functions from the module, ensure that the Saxon-HE 9.8.x JAR file is saved in the lib subdirectory of the BaseX installation directory.

Usage

Currently, basex-rdf includes an XQuery library module, basex-rdf.xqm, and two XSLT stylesheets, process.xsl and postprocess.xsl. The first stylesheet (process.xsl) normalizes the raw XML parse tree, and the second exposes some simple abstractions for querying the RDF data. The XQuery library module acts as a controller for calling the stylesheets.

Namespaces

The parser component of the combined Java/XQuery module is bound to the following namespace:

http://basex.org/modules/rdf/Graphs (here bound to the prefix "graphs")

The XQuery library module takes the following namespace:

https://metadatafram.es/basex/modules/rdf/graphs/ (here bound to the prefix "basex-rdf")

Functions

graphs:parse(xs:string)
  Parses RDF data as a string and returns an XML parse tree.
basex-rdf:transform(xs:string)
  Accepts a string of RDF data and calls graphs:parse() to return an XML parse tree. 
  Passes the parsed data to the process.xsl stylesheet.
  Returns a normalized XML document of RDF statements.  
basex-rdf:pass-options(element(options))
  Helper function. Accepts a set of options in an <options> element.
  Passes the options to the basex-rdf:query() function.  
basex-rdf:query(document-node(), element(options))
  Accepts the normalized RDF document and query options.
  Calls the postprocess.xsl stylesheet to query the data.  

Getting started

The basex-rdf:query function implements a set of simple abstractions for navigating RDF graphs, loosely based on the navigation functions implemented by the RDFLib Python package.

This function can be used to query small datasets, but for anything larger, internal BaseX value indexes for text and attributes would be advised.

The basex-rdf.xq main module provides a simple example of querying parsed RDF data in BaseX.

The options element can be used to declare basic graph query patterns. For example:

<options>
  <subject></subject>
  <verb>rdf:type</verb>
  <object></object>  
</options>

can be used to list all subject-object pairs linked by the rdf:type predicate. Note the use of the qualified name in the predicate; prefixes must match the ones declared in the RDF source data. Alternatively, an unqualified IRI (e.g., http://www.w3.org/1999/02/22-rdf-syntax-ns#type) may be used instead.

TODO

  • Incorporate test suite using XSpec
  • Back-convert from internal XML representation to Turtle, etc.
  • Map internal XML representations to JSON-LD
  • Implement internal transformation as XQuery rather than XSLT
  • Add further examples, etc.

License

The basex-rdf module is licensed under GPLv3. Parsers generated by the REx Parser Generator are supplied under the Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].