You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by adolby <gi...@git.apache.org> on 2016/05/15 14:15:11 UTC

[GitHub] jena pull request: JENA-1180: Add support for ComplexPhraseQueryPa...

GitHub user adolby opened a pull request:

    https://github.com/apache/jena/pull/146

    JENA-1180: Add support for ComplexPhraseQueryParser to jena-text

    This PR expands on JENA-1134, which added support for new query parsers in jean-text. ComplexQueryParser is useful for performing wildcard or fuzzy search on terms in phrases.
    
    I\u2019ve attempted to follow the pattern for adding a query parser as in JENA-1134, but I may have duplicated some functionality in the unit test, when I should have restructured instead.
    
    The test needs to specify the TTL spec analyzer and parser, which is available in TestDatasetWithConfigurableAnalyzer\u2019s method makeSpec. However, TestDatasetWithConfigurableAnalyzer inherits from TestDatasetWithKeywordAnalyzer, which isn\u2019t the analyzer the ComplexPhraseQuery needs to test.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/adolby/jena master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/jena/pull/146.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #146
    
----
commit b89f0ea4fcfef4443ce813b8026bb9fda965e668
Author: Andrew Dolby <an...@gmail.com>
Date:   2016-05-15T13:59:38Z

    Add support for ComplexPhraseQueryParser to jena-text

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] jena pull request: JENA-1180: Add support for ComplexPhraseQueryPa...

Posted by adolby <gi...@git.apache.org>.
Github user adolby commented on the pull request:

    https://github.com/apache/jena/pull/146#issuecomment-219598981
  
    Thank you for working on that refactoring! You're right, abstracting out makeSpec reduces the repetition for the ComplexPhraseQueryParser test. I've switched it over to inheriting from AbstractTestDatasetWithAnalyzer. Are there other changes you'd like to see in this PR? I'm not sure if/where documentation should be updated to reflect having the ComplexPhraseQueryParser as a QueryParser option.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] jena pull request: JENA-1180: Add support for ComplexPhraseQueryPa...

Posted by osma <gi...@git.apache.org>.
Github user osma commented on the pull request:

    https://github.com/apache/jena/pull/146#issuecomment-219381471
  
    Thanks for the PR!
    
    The code looks good, as you say it's following the pattern established by JENA-1134.
    
    You are right about the unit tests - the inheritance hierarchy of analyzer-related unit tests is rather messy. There is a very long inheritance chain and e.g. TestDatasetWithAnalyzingQueryParser  indirectly inherits from TestDatasetWithKeywordAnalyzer. There is actually a sort of logic here, because the tests specified in TestDatasetWithKeywordAnalyzer will also be run on the subclasses, as the analyzer configurations are compatible. This gives us some unit tests "for free".
    
    I did some reorganizing of the test classes, namely, I abstracted out AbstractTestDatasetWithAnalyzer from TestDatasetWithKeywordAnalyzer (see https://github.com/apache/jena/commit/8a20f238ffc5aed23648b038132fe74cbca2c85c). Unless I'm missing ssomething, you should now be able to inherit from AbstractTestDatasetWithAnalyzer and avoid doing the full makeSpec in your test class. Would you mind switching over to that?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] jena pull request: JENA-1180: Add support for ComplexPhraseQueryPa...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/jena/pull/146


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] jena pull request: JENA-1180: Add support for ComplexPhraseQueryPa...

Posted by afs <gi...@git.apache.org>.
Github user afs commented on the pull request:

    https://github.com/apache/jena/pull/146#issuecomment-219649421
  
    You can merge it.
    
    The principle is that any contribution needs to be clearly given by the original owner. Someone making sending a Pull Request is taking a step that clearly says "This is for the project" and so the Apache contribution is clear. 
    
    We ask for additional paperwork when the contribution is large, and if they come by a different route to JIRA, or a PR to the project, we'll have to think about it.
    
     A PR like this can be dealt with as being clearly intended as being a contribution.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] jena pull request: JENA-1180: Add support for ComplexPhraseQueryPa...

Posted by osma <gi...@git.apache.org>.
Github user osma commented on the pull request:

    https://github.com/apache/jena/pull/146#issuecomment-219629095
  
    I think the code is now good for merging. Thanks a lot!
    
    @afs Can I just merge the code to master, or is there some legal policy that must be followed for contributions like this? I've never merged PRs initiated by others.
    
    As for documentation, it lives outside this github repository (in the ASF SVN) and you can submit a patch via the web CMS - just click on "Improve this page" at the top of https://jena.apache.org/documentation/query/text-query.html
    
    We can close this PR after the code is merged, then resolve the JIRA issue after the documentation has been updated.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---