Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug] TriG serialization of result generate incorrect triples #151

Closed
MaillPierre opened this issue Oct 27, 2023 · 2 comments
Closed

[Bug] TriG serialization of result generate incorrect triples #151

MaillPierre opened this issue Oct 27, 2023 · 2 comments

Comments

@MaillPierre
Copy link
Member

Issue Description:

I retrieve the content of my corese dataset with a CONSTRUCT { GRAPH ?g { ?s ?p ?o } } WHERE { GRAPH ?g { ?s ?p ?o } } query, with "accept": "application/trig" as header. When constructing my KG from the content of some external sources, the TriG file returned by Corese is sometimes not valid. The brackets < and > are missing from some properties.

Bug Details:

There are no error messages on the corese side, but any parser receiving the data fails to parse the TriG content because of that.

Steps to Reproduce:

  1. Create data that generates the bug:
INSERT DATA {
  <http://bio2rdf.org/lsr:aclame> <http://bio2rdf.org/lsr_vocabulary:x-miriam> <http://bio2rdf.org/miriam:00000063>
}
  1. Retrieve the data in TriG format, with "accept": "application/trig" as header
CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }
  1. The result of the CONSTRUCT query is:
@prefix ns1: <http://bio2rdf.org/> .


<http://bio2rdf.org/lsr:aclame> http://bio2rdf.org/lsr_vocabulary:x-miriam <http://bio2rdf.org/miriam:00000063> .

Expected Behavior:
The content of the result of the CONSTRUCT should be equivalent to the triple created.

Note to Developers:
My hypothesis is that the presence of a second ":" in the property URI messes up in some way the TriG serializer.
This could also impact ticket #149 , and using the CONSTRUCT as I do now is already my only solution to retrieve the content of my Corese server.

Details
Tested on corese-server-4.4.1.jar

@MaillPierre
Copy link
Member Author

Temporary fix was implemented using the regex:

/(\s)(([a-zA-Z0-9-]+:\/\/(([a-zA-Z0-9-]+\.)?[a-zA-Z0-9-]+)+(\.[a-zA-Z0-9\-_:]+)\/)([a-zA-Z0-9\-_:])*)(\s+)/g

replaced by:

$1<$2>$8

@remiceres
Copy link
Collaborator

Hello Pierre,

Thank you for your report. The bug has been fixed and will be available in the next release of Corese (4.4.2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants