Yeah, you can have :
in prolog atoms and predicates too. At least it’s supported in SWI prolog, I suspect most other prologs too.
I tried finding a canonical reference for you, but most descriptions of the syntax are informally specified. Unfortunately the ISO standard is paywalled.
ISO prolog was I believe largely derived from Edinburgh prolog… but I can’t find any good references their either. I think most implementers don’t care much for ISO prolog tbh
It looks like adding an extra tag would be appropriate
A familiar syntax would be to add a tag like this to the comments:
@prefix rdf: <<http://www.w3.org/1999/02/22-rdf-syntax-ns#>> .
Do you mean literally that? Or putting it in a pabu comment? e.g.
%@prefix rdf: <<http://www.w3.org/1999/02/22-rdf-syntax-ns#>> .
in a comment
That way it would look like a SWI-Prolog structured comment
It would just be a new tag https://www.swi-prolog.org/pldoc/man?section=tags
Incidentally the standards body added to turtle 1.1 SPARQL like prefix support in addition to @prefix
So arguably because of SPARQL
PREFIX rdf: <<http://www.w3.org/1999/02/22-rdf-syntax-ns#>>
is more well known.
Obviously that won’t align with a swipl comment tag
Incidentally I think those tagged comments might only be expected inside /** comment blocks */
honestly, I always forgot which syntax did which. I copy/pasted and focused either on data or on queries.
Yeah me too… it’s just frustrating when you copy/paste a turtle @style
one into a SPARQL query 😩 or you skip the @
but leave the .
Go to the SPARQL query doc, and the first appearance of a prefix syntax is section https://www.w3.org/TR/sparql11-query/#docDataDesc: > This document uses the http://www.w3.org/TR/turtle/ [https://www.w3.org/TR/sparql11-query/#TURTLE] data format to show each triple explicitly. Turtle allows IRIs to be abbreviated with prefixes:
@prefix dc: <<http://purl.org/dc/elements/1.1/>> .
@prefix : <<http://example.org/book/>> .
:book1 dc:title "SPARQL Tutorial" .
The query form is almost identical except: • no @ • no trailing .
IKR 😩
I do like SPARQL, but some parts of it frustrate me no end
yeah
I’m hoping to put a SPARQL front-end over Asami. If I ever get the time
TBH I might mention that on the SPARQL 1.2 issues…. they should really axe that @prefix dc: ....
stuff from the document and use the turtle 1.1 style to help prevent confusion.
If you recall the https://youtu.be/oyLBGkS5ICk?list=PLZdCLR02grLofiMKo0bCeLHZC0_2rpqsz from the 2016 Conj, he said that you shouldn’t axe anything 🙂
But I’d be all for accepting both forms
Yeah I’m definitely not suggesting axing support for it all, it should remain standardised in turtle.
I’m just suggesting that the SPARQL 1.2 sample data should be updated to use the turtle 1.1 feature (of SPARQL style PREFIX:
blocks; i.e. a small step to preventing the confusion.
Granted it might further add to that confusion; but it will at least mean people copy/pasting example data in that document into sparql etc won’t trip up.
Anyway this is an irrelevance 🙂