SmartDataAnalytics / Sparqlify

Sparql -> SQL Rewriter enabling virtual RDB -> RDF mappings
http://aksw.org/Projects/Sparqlify
121 stars 13 forks source link

Enable use of prefixes in concats #5

Closed KonradHoeffner closed 11 years ago

KonradHoeffner commented 12 years ago

At the moment, you still need to do something like " ?cityUri = uri(concat("http://fp7-pp.publicdata.eu/resource/", fn:urlEncode(?2), "-", fn:urlEncode(?1)))" when there is nothing behind the prefix, but it would be better to be able to use " ?cityUri = uri(concat("myprefix:", fn:urlEncode(?2), "-", fn:urlEncode(?1)))" instead.

Aklakan commented 12 years ago

Ideally, we could use prefixes just as plain strings; however not sure right now if this causes troubles with the parser. Alternatively, we might (re)use some prefix or suffix escape character, such as '@' or '::'

Prefix ex:<http://example.org/>
...
?s = uri(concat(ex, "bar")) // Maybe the ideal way of doing it
?s = uri(concat(@ex, "bar")) // Should be fine as well
?s = uri(concat(ex::, "bar")) // Don't think I would like having a special escape suffix
?s = uri(ex:bar) // This already works

Opinions?

(Btw, do I see it correctly, that R2R-ML does not allow prefix references in templates? Which brings me to the point, that for the sake of compatibility, it should be possible to support R2R-MLs templates; but this is subject for another issue.)

Aklakan commented 11 years ago

SML was extended with this feature: You can now do: uri(concat(ex:, ?id))

Heck, you can even omit the concat in uri(...) now