-
Notifications
You must be signed in to change notification settings - Fork 165
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
GH-3992 add sparql parser default prefixes #3993
GH-3992 add sparql parser default prefixes #3993
Conversation
Hi, thanks for the PR, just wondering if e.g. a |
True! I wasn't aware of the existence of this package, I've replaced the map to a set parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to make a case for using Collections.emptyMap() in favor of passing around null
for the custom prefix map. Your code would be simpler and probably safer if you could always assume the prefix map to exist. I pointed out a few bits of code that could be made more elegant with an empty map.
...ryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/PrefixDeclProcessor.java
Outdated
Show resolved
Hide resolved
...ryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/PrefixDeclProcessor.java
Outdated
Show resolved
Hide resolved
...ryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/PrefixDeclProcessor.java
Show resolved
Hide resolved
core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParser.java
Outdated
Show resolved
Hide resolved
Yes, I was a bit lazy to check if the |
e8baebc
to
b7aa63f
Compare
Hi, is there something blocking? I'm in favour of this pull request : ) |
Thanks for the enhancement ! |
b7aa63f
to
fe916a3
Compare
Done, I was thinking it was squashed enough. |
fe916a3
to
30ee077
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added some comments. If you agree with my comments then ping me with @hmottestad when you're done and I'll merge this PR so it will be included in the upcoming 4.1.0 release.
core/queryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParser.java
Outdated
Show resolved
Hide resolved
...ryparser/sparql/src/main/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserFactory.java
Outdated
Show resolved
Hide resolved
...queryparser/sparql/src/test/java/org/eclipse/rdf4j/query/parser/sparql/SPARQLParserTest.java
Show resolved
Hide resolved
30ee077
to
664e355
Compare
GitHub issue resolved: #3992
Briefly describe the changes proposed in this PR:
This PR add a constructor to the SPARQLParser class and a new method in the SPARQLParserFactory to add custom default prefixes to the parser.
Example
PR Author Checklist (see the contributor guidelines for more details):
mvn process-resources
to format from the command line)