We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turtle mode setup:
(autoload 'n3-mode "n3-mode") (define-derived-mode Turtle-mode n3-mode "Turtle") (add-hook 'Turtle-mode-hook 'turn-on-font-lock) (add-to-list 'auto-mode-alist '("\\.ttl$" . Turtle-mode)) (add-to-list 'auto-mode-alist '("\\.ttls$" . Turtle-mode)) ; TODO: Extend for Turtle*. http://graphdb.ontotext.com/documentation/9.2/free/devhub/rdf-sparql-star.html#mime-types-and-file-extensions-for-rdf-in-rdf4j (add-to-list 'auto-mode-alist '("\\.trig$" . Turtle-mode)) (add-to-list 'auto-mode-alist '("\\.r2rml$" . Turtle-mode)) (add-to-list 'auto-mode-alist '("\\.shacl$" . Turtle-mode)) (add-to-list 'auto-mode-alist '("\\.n3$" . Turtle-mode)) (add-to-list 'auto-mode-alist '("\\.nt$" . Turtle-mode)) (add-to-list 'auto-mode-alist '("\\.owl$" . Turtle-mode))
Turtle validation with jena riot.
riot
(flycheck-define-checker rdf-riot "RDF syntax checker using riot and script riotval.pl to prepend prefixes.ttl." :command ("perl" "-S" "riotval.pl" source) :error-patterns ((error "ERROR riot " (* " ") ":: [line: " line ", col: " column (* " ") "] " (message))) :modes (n3-mode ttl-mode Turtle-mode)) (add-to-list 'flycheck-checkers 'rdf-riot)
This uses an extra script riotval.pl to prepend prefixes.ttl (as used by rdfpuml), then subtract its length from error messages:
riotval.pl
prefixes.ttl
rdfpuml
#!perl -w # Validate a turtle file with riot --validate; optionally prepending prefixes.ttl my $file = shift or die "usage: riotval file.(ttl|trig)\n"; my $syntax = $file =~ m{\\.ttl$} ? "turtle" : "trig"; if (-e "prefixes.ttl") { my ($lines) = `wc -l prefixes.ttl` =~ m{(\d+)}; my $out = `cat prefixes.ttl $file | riot --validate --syntax $syntax - 2>&1`; $out =~ s{(?<=:: \[line: )(\d+)}{$1 - $lines}ge; print $out } else { print `riot --validate --syntax $syntax $file` }
If you don't use prefixes.ttl then things get simpler:
:command ("riot" "--validate" source)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Turtle mode setup:
Turtle validation with jena
riot
.This uses an extra script
riotval.pl
to prependprefixes.ttl
(as used byrdfpuml
), then subtract its length from error messages:If you don't use
prefixes.ttl
then things get simpler:The text was updated successfully, but these errors were encountered: