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

Investigate issue with Oxigraph query parser #11

Open
GregHanson opened this issue Sep 13, 2024 · 3 comments
Open

Investigate issue with Oxigraph query parser #11

GregHanson opened this issue Sep 13, 2024 · 3 comments
Assignees

Comments

@GregHanson
Copy link

GregHanson commented Sep 13, 2024

the following sparql file results in an oxigraph error:

PREFIX data: <http://www.decisym.ai/data#>
PREFIX xml2rdf: <http://ids.unimaas.nl/xml2rdf/model#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?name
WHERE {
  ?component rdf:type xml2rdf:bom.components.component.name .
  ?component xml2rdf:hasValue ?name .
}

and the error in question:

error at 7:90: expected one of ".", ":", ['-' | '0' ..= '9' | '\u{00B7}' | '\u{0300}'..='\u{036F}' |
    '\u{203F}'..='\u{2040}'], ['A' ..= 'Z' | 'a' ..= 'z' | '\u{00C0}'..='\u{00D6}' | '\u{00D8}'..='\u{00F6}'
    | '\u{00F8}'..='\u{02FF}' | '\u{0370}'..='\u{037D}' | '\u{037F}'..='\u{1FFF}'
    | '\u{200C}'..='\u{200D}' | '\u{2070}'..='\u{218F}' | '\u{2C00}'..='\u{2FEF}'
    | '\u{3001}'..='\u{D7FF}' | '\u{F900}'..='\u{FDCF}' | '\u{FDF0}'..='\u{FFFD}'], ['_']
[2024-09-13T14:44:30Z ERROR de] Error during execution: error at 7:90: expected one of ".", ":", ['-' | '0' ..= '9' | '\u{00B7}' | '\u{0300}'..='\u{036F}' |
    '\u{203F}'..='\u{2040}'], ['A' ..= 'Z' | 'a' ..= 'z' | '\u{00C0}'..='\u{00D6}' | '\u{00D8}'..='\u{00F6}'
    | '\u{00F8}'..='\u{02FF}' | '\u{0370}'..='\u{037D}' | '\u{037F}'..='\u{1FFF}'
    | '\u{200C}'..='\u{200D}' | '\u{2070}'..='\u{218F}' | '\u{2C00}'..='\u{2FEF}'
    | '\u{3001}'..='\u{D7FF}' | '\u{F900}'..='\u{FDCF}' | '\u{FDF0}'..='\u{FFFD}'], ['_']

This query file is accepted and behaves as expected when using the sparql CLI directly execute a query - so there is a difference in the allowed syntax between tools

Query file without the PREFIX works as expected

PREFIX data: <http://www.decisym.ai/data#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT ?name
WHERE {
  ?component rdf:type <http://ids.unimaas.nl/xml2rdf/model#bom.components.component.name> .
  ?component xml2rdf:hasValue ?name .
}
@GregHanson
Copy link
Author

I'm assuming it doesn't like the <value>.<value>.<value> following the prefix , maybe potentially trying to improperly parse it as a url?

@GregHanson
Copy link
Author

GregHanson commented Sep 13, 2024

TODO:

  • rebase fork with latest upstream
  • verify failure
  • open issue in upstream oxigraph repo if still present

@GregHanson GregHanson self-assigned this Sep 13, 2024
@GregHanson
Copy link
Author

specific line in question:
https://github.com/DeciSym/oxigraph/blob/main/lib/oxigraph/src/sparql/mod.rs#L44

pub(crate) fn evaluate_query(
    reader: StorageReader,
    query: impl TryInto<Query, Error = impl Into<EvaluationError>>,
    options: QueryOptions,
    run_stats: bool,
) -> Result<(Result<QueryResults, EvaluationError>, QueryExplanation), EvaluationError> {
    let query = query.try_into().map_err(Into::into)?;  ## HERE

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

1 participant