Giter VIP home page Giter VIP logo

turtlevalidator's Introduction

TurtleValidator

RDF NTriples/Turtle validator using Ruben Verborgh's N3 NodeJS library. Validate Turtle and Ntriples documents on syntax and XSD datatype errors through command line.

© 2014, 2015 - IDLab - Ghent University - imec Source code: https://github.com/MMLab/TurtleValidator

Install:

npm install -g turtle-validator

Examples:

$ ttl <path-to-file ...>
$ curl http://data.linkeddatafragments.org/dbpedia -H "accept: text/turtle" | ttl
$ ttl http://triples.demo.thedatatank.com/demo.ttl

Or install the browser client

# Equivalent to: npm build
npm install
browserify lib/validator.js -o public/js/ttl.js

Then use it in your browser using the index.html in the public folder. You can run this locally as follows.

# Equivalent to: npm start
npm install
browserify lib/validator.js -o public/js/ttl.js
ws

turtlevalidator's People

Contributors

dependabot[bot] avatar dieterdepaepe avatar mielvds avatar pellejacobs avatar pietercolpaert avatar rubenverborgh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

turtlevalidator's Issues

Ambiguous parsing issue

Dear all!

I potentially found some problem when parsing turtle for validation. The following turtle snippet works as an example:

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

@prefix ctrl:   <http://w3id.org/ibp/CTRLont#> .

@prefix : <http://example.org/test#> .

# Note the newline below
:item a ctrl:ControlActor , owl:NamedIndividual ;

:item ctrl:hasInput :input .

The turtle validator states this syntax is correct; However, when loading it to GraphDB I receive an error.

I am not sure if this indeed is valid turtle and it would be great to discuss. If it is valid I will shift this issue towards the GraphDB developers.

Thanks in advance!

Georg

How do I cite this tool?

Hi, I used your tool for my project to validate my .ttl file, which will be part of a publication. How can I cite this work, this project? I see you have a clear license, but it might be useful to add a DOI to your GitHub page. Are you planning to publish on this project?

Request: Expose validator with a Javascript API

Hi!

Cool little application you've made here. Useful for when one is uncertain about why a Turtle file wont parse.

I have a request though: would it be possible to install it as a Javascript library? By that I mean the possibility of installing it in my own client side application, and for example importing a function called "validateTurtle"?

The "validateTurtle" function could for example return an object like: { validated: false, reason: "Something went wrong" }. That would make it easier for me as a developer to ensure that the uploaded (in our case we upload Turtle files to a store) is actually a valid Turtle.

Typos with double columns not caught

Hello,

I use your http://ttl.summerofcode.be/ tool almost everyday. It saves so much time for files that are sometimes gigantic !

I recently lost my mind over a mapping that did not go through :

@prefix rr:     <http://www.w3.org/ns/r2rml#> .
@prefix era:	<http://data.europa.eu/949/> .
@prefix skos:	<http://www.w3.org/2004/02/skos/core#> .
@prefix prov:   <http://www.w3.org/ns/prov#> .

<https://data.infrabel.be/mapping/rinf/Link/opStart-opEnd/>
  skos:comment "Maps the link between Operational Point and SectionOfLine start with the ERA vocabulary";
  prov:used <https://data.infrabel.be/mapping/rinf/Link/SectionOfLine/OperationalPoint/>;
  a prov:Activity,
    rr:TriplesMap;

  rr::logicalTable [rr:sqlQuery """
  select op.uniqueopid, linesectionid
  from s1390.rinf_operationalpoint op
  join s1390.rinf_section_of_line sol on op.ptcar_id = sol.ptcar_from  
  """ ; ];

  rr:subjectMap [
    rr:template "https://data.infrabel.be/data/SectionOfLine/{linesectionid}" ; 
    rr:termtype rr:IRI  ];

  rr:predicateObjectMap [
    rr:predicate era:opStart;
    rr:objectMap [ rr:template "https://data.infrabel.be/data/OperationalPoint/{uniqueopid}";
                  rr:termtype rr:IRI ]].

If we copy and paste this into the tool, it does not catch that we have a typo rr::logicalTable (two columns instead of only one). Perhaps it's still valid turtle but I'm not really sure.

exit with error code if errors

I was expecting the following behavior

ttl my_ttl_file_with_errors.ttl && echo "success" || echo "failed"
# => failed

instead this is what happens

ttl my_ttl_file_with_errors.ttl && echo "success" || echo "failed"
# => success

the reason being that the process exit code is always 0: could there by a process.exit(1) in case an error was detected, either by default or with an option passed to the executable?

thanks for this great tool!

spaces in filepath

Thanks for your tool! It's useful.

I found a small issue. It seems not be able to handle filenames/filepaths with spaces.

ttl "/Users/rick/Documents/Wikipedia/Deelcollectie Nederlandse Spoorwegen/2 juni/THWTW-CommonsCategories.ttl"
[Error: ENOENT: no such file or directory, open '/Users/rick/Documents/Wikipedia/Deelcollectie%20Nederlandse%20Spoorwegen/2%20juni/THWTW-CommonsCategories.ttl'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/rick/Documents/Wikipedia/Deelcollectie%20Nederlandse%20Spoorwegen/2%20juni/THWTW-CommonsCategories.ttl'
}

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.