linked-csv icon indicating copy to clipboard operation
linked-csv copied to clipboard

Sniff URL values (starting with http:)

Open JeniT opened this issue 12 years ago • 3 comments

@kidehen suggests sniffing URL values (those beginning with http:). See https://twitter.com/kidehen/status/327541085985439744

JeniT avatar Apr 25 '13 21:04 JeniT

Sniffing would cover different scenarios but, CSV outputs from a SPARQL query can already come with HTML anchors:

BIND(CONCAT("<a href=\"", str(?iriA), "\">", str(?iriA), "</a>") AS ?iriB)

csarven avatar Apr 28 '13 10:04 csarven

I don't think that's what @kidehen had in mind: the idea is that normal values in the linked CSV file could be recognised as URLs (just as numbers are recognised as numbers) without there being an explicit type in the type prolog line.

JeniT avatar Apr 28 '13 13:04 JeniT

Hi all, I returned to this issue and started working on it again. In the Pull Request, @JeniT suggested that this is done through recognizing (sniffing) that a value is an URL, and assigning it the URL type. After this, the rest of the code should treat and display the value as an URL.

I wanted to ask, where do you think it would be most appropriate to put this sniffing code?

My thought is that it should be done in the parseValue function (in jquery.linked-csv.js), when the app check if the type === 'url'. I'd put a regex in the same if condition, so that the app recognizes an entry as an URL either by the type parameter, or by the regex match.

mjovanovik avatar Jan 20 '14 12:01 mjovanovik