Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to load GeoSPARQL TTL #42

Open
flamsens opened this issue Dec 19, 2023 · 1 comment
Open

Unable to load GeoSPARQL TTL #42

flamsens opened this issue Dec 19, 2023 · 1 comment
Labels
bug Something isn't working parser Parser related, most likely parsing failed

Comments

@flamsens
Copy link

Parsing the GeoSPARQL ontology as TTL throws an error:

<?php
require('vendor/autoload.php');
$g = new \EasyRdf\Graph('https://www.opengis.net/ont/geosparql');
$g->load();

PHP Warning:  Uncaught EasyRdf\Parser\Exception: Turtle Parse Error: illegal subject type: literal on line 122, column 15 in /vendor/sweetrdf/easyrdf/lib/Parser/Turtle.php:340
Stack trace:
#0 /vendor/sweetrdf/easyrdf/lib/Parser/Turtle.php(261): EasyRdf\Parser\Turtle->parseSubject()
#1 /vendor/sweetrdf/easyrdf/lib/Parser/Turtle.php(150): EasyRdf\Parser\Turtle->parseTriples()
#2 /vendor/sweetrdf/easyrdf/lib/Parser/Turtle.php(116): EasyRdf\Parser\Turtle->parseStatement()
#3 /vendor/sweetrdf/easyrdf/lib/Graph.php(252): EasyRdf\Parser\Turtle->parse()
#4 /vendor/sweetrdf/easyrdf/lib/Graph.php(387): EasyRdf\Graph->parse()
#5 php shell code(1): EasyRdf\Graph->load()
#6 {main}
  thrown in vendor/sweetrdf/easyrdf/lib/Parser/Turtle.php on line 340

The Turtle file loads here: https://service.tib.eu/webvowl/#iri=http://www.opengis.net/ont/geosparql

@k00ni k00ni added the bug Something isn't working label Dec 20, 2023
@k00ni
Copy link
Member

k00ni commented Dec 20, 2023

Thank you for reporting.

I tried your file with Protégé and it was able to read the file. It seems EasyRdf is not able to handle certain Turtle code, such as:

# copied from line 99 - 110 of your ontology file
:gmlLiteral
	a rdfs:Datatype ;
	rdfs:isDefinedBy
		: ,
		<http://www.opengis.net/spec/geosparql/1.0/req/geometry-extension/gml-literal> ,
		<http://www.opengis.net/spec/geosparql/1.1/req/geometry-extension/gml-literal> ;
	skos:definition """A GML serialization of a Geometry object."""@en ;
	rdfs:seeAlso <https://portal.ogc.org/files/?artifact_id=20509> ;
	skos:prefLabel "GML Literal"@en ;
	skos:example
		spec11:B.1.2.4 ; #            <==== it fails here
.

If I understand Turtle specification (https://www.w3.org/TR/turtle/#grammar-production-PN_LOCAL) correctly, even though the part ...

	skos:example
		spec11:B.1.2.4 ;
.

.. looks weird, it is valid Turtle.

Unfortunately I don't have the time right now to do more research how to fix this. But if you like to contribute a bug fix, I would be happy to help.

@k00ni k00ni added the parser Parser related, most likely parsing failed label Dec 20, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working parser Parser related, most likely parsing failed
Projects
None yet
Development

No branches or pull requests

2 participants