Git Product home page Git Product logo

rdf-syntax-converter's Introduction

RDF Syntax Converter

A small and simple RDF syntax converter built in Python using the RDFLib.

Table of Contents

Overview

RDF is a standard model for data interchange on the Web, standardized by the World Wide Web Consortium (W3C).

The following table presents the allowed input and output RDF syntaxes. I.e., the RDF Syntax Converter can convert from and to the following syntaxes:

Allowed Syntax File Extension
JSON-LD .jsonld
N3 .n3
N-Triples .nt
RDF/XML .rdf, .owl, .xml
TriG .trig
Turtle .ttl

The software accepts as input any URL or file formatted in one of the mentioned syntaxes and generates a file with the desired target syntax as output.

Limitations

This software is a simple implementation of an RDF syntax converter that relies on the RDFLib v6.2.0 capabilities. It was created for training purposes and, hence, no refinements were performed.

The software was not extensively tested and does not count with advanced errors and exceptions handlings or even non-standard use verifications. The software was developed in a Windows environment and was not tested in Linux or Mac.

Software requirements

You need to download and install Python for executing the RDF Syntax Converter. The code was developed and tested using Python v3.10.5.

Only two external libraries are necessary: RDFLib (v6.2.0) and Tabulate (v0.8.10). For installing these libraries, run the following command on the terminal:

pip install -r requirements.txt

Code execution

After the external libraries are installed, run the following command on the terminal for executing the RDF Syntax Converter:

python rdfconv.py <input file OR URL> <output file>

While the input syntax is automatically detected by the RDF Syntax Converter, the target syntax is chosen via the output filetype (file extension) informed by the user as the software argument.

Usage examples

Converting a web RDF-based file to a JSON-LD file (saved in the same directory of the rdfconv.py file):

python rdfconv.py http://purl.org/nemo/gufo gufo.jsonld

Converting an OWL file formatted in XML/RDF to a Turtle (TTL) file (both input and output files are saved in the same directory of the rdfconv.py file):

python rdfconv.py ontology.rdf ontology.ttl

Contributions

Every contribution is very welcomed!

Problem reporting, new feature requests, questions, or ideas can be sent through this repository’s issues section. Coding contributions are also accepted and can be done via the repository’s PR section.

This is a free open-source project. If you use it and like it, you can buy me a coffee 😄

rdf-syntax-converter's People

Contributors

pedropaulofb avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.