NatLibFi / Skosmos

Thesaurus and controlled vocabulary browser using SKOS and SPARQL
Other
218 stars 94 forks source link

Turtle output with fragment URIs is invalid #1591

Open namedgraph opened 5 months ago

namedgraph commented 5 months ago

URL address of the page where you encountered the problem

Description of the problem

I copy-pasted Skosmos Turtle output into http://ttl.summerofcode.be and it does parse, nor does it with Jena's riot

The error:

Expected punctuation to follow "https://data.beamery.com/aaa/bbb/ccc/1287" on line 14.

The relevant bit of data looks like this:

@prefix smth: <https://data.beamery.com/aaa/bbb/ccc/> .

... skos:relatedMatch smth:1287#this

I don't think the prefix:local-name#fragment syntax is valid. You should look into the RDF I/O library that is producing this.

namedgraph commented 3 months ago

@osma can you confirm?

osma commented 3 months ago

Thanks for the report @namedgraph . Indeed the likely culprit here is the EasyRdf library that Skosmos uses for RDF handling; specifically we use the sweetrdf/EasyRdf fork. Currently we have pinned the dependency on version 1.7.*:

https://github.com/NatLibFi/Skosmos/blob/main/composer.json#L8

The same version is currently used both on the main branch (Skosmos 3, heavily WIP) and on the legacy skosmos-2 branch that you are likely using.

It seems like this kind of bug was fixed in sweetrdf/EasyRdf 1.10: see https://github.com/sweetrdf/easyrdf/pull/35 for the actual PR. Though I'm not sure if this is exactly the same bug or just similar. The most recent release is 1.11.

@namedgraph can you provide a minimal test case that demonstrates the problem? Your report now just included the symptoms but not the original vocabulary data that was used. A test case would allow testing newer EasyRdf versions to see if the problem goes away. You can also try this yourself: bump the EasyRdf dependency in composer.json, see if it helps and report back.

One possible complication when upgrading EasyRdf (if that's what is needed) is that Skosmos 2 still supports PHP versions 7.3 and 7.4, but sweetrdf/EasyRdf dropped support for 7.x in version 1.9.

osma commented 2 weeks ago

@nikopartanen Can you add the SKOS-XL examples from YSO that we know of?

nikopartanen commented 2 weeks ago

Certainly! This one breaks because of the North Sámi label:

http://www.yso.fi/onto/yso/p3448

This breaks due to the label that marks outdated usage:

http://www.yso.fi/onto/yso/p17004

These are two major categories for which we currently use SKOS-XL. I think this problems involves all SKOS-XL labels that we have. I can collect a larger list of these if needed? The North Sámi labels are generated automatically and the cultural sensitivity labels are done manually. To my knowledge both should have identical structure.