You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by afs <gi...@git.apache.org> on 2017/02/25 11:06:30 UTC

[GitHub] jena pull request #218: JENA-1294: Don't use contants during initialization.

GitHub user afs opened a pull request:

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

    JENA-1294: Don't use contants during initialization.

    Fixes for RDFS - use functions for constants during initialization.
    
    This fixes initialization as reported (TestParameterizedSparqlString).
    
    RDF and OWL still to do in the same style for some rather unusual ways to trigger the same effect.


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

    $ git pull https://github.com/afs/jena jena_init

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

    https://github.com/apache/jena/pull/218.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 #218
    
----
commit 258a390bc239a62583cf020b5fe57c922b158d42
Author: Andy Seaborne <an...@apache.org>
Date:   2017-02-25T10:43:48Z

    JENA-1294: Don't use contants during initialization.
    
    Use the RDFS.Init.<const>() function instead.

----


---
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 issue #218: JENA-1294: Don't use contants during initialization.

Posted by alexishuf <gi...@git.apache.org>.
Github user alexishuf commented on the issue:

    https://github.com/apache/jena/pull/218
  
    Tested here and it solved everything. Thanks!
    
    Before this PR, Initializing from OWL was only a problem if TDB was also initialized. Maybe is it a good idea to add `TestSystemSetup`  to `org.apache.jena.tdb.sys.TS_Sys`?


---
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 #218: JENA-1294: Don't use contants during initialization.

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

    https://github.com/apache/jena/pull/218#discussion_r103077064
  
    --- Diff: jena-arq/src/main/java/org/apache/jena/query/ARQ.java ---
    @@ -579,7 +580,7 @@ public static void init() {
                 JenaSystem.logLifecycle("ARQ.init - start") ;
                 // Force constants to be set.  This should be independent of other initialization including jena core.
                 ARQConstants.getGlobalPrefixMap();
    -            
    +            ResultSetLang.init();
    --- End diff --
    
    This isn't directly related but I noticed that `ResultSetLang` init into RDFLangauge was happens later. Making it happen now was part of verification there were no other lurking problems.


---
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 issue #218: JENA-1294: Don't use contants during initialization.

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

    https://github.com/apache/jena/pull/218
  
    ".exe" append integrated in.
    
    I had some problems in the build (because of a static method called "Property()") but all fixed now so this PR should be complete.  I'll merge it soon unless someone has an more comments.
    



---
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 #218: JENA-1294: Don't use contants during initialization.

Posted by alexishuf <gi...@git.apache.org>.
Github user alexishuf commented on a diff in the pull request:

    https://github.com/apache/jena/pull/218#discussion_r103085413
  
    --- Diff: jena-core/src/test/java/org/apache/jena/test/TestSystemSetup.java ---
    @@ -35,5 +42,24 @@ public void testRDF11() {
                 fail("RDF 1.0 mode enabled in Jena3 test run") ;
         }
     
    +    /** This test relies on forking a clean JVM */ 
    +    public void testInitFromRDFS() throws IOException, InterruptedException {
    +        String separator = System.getProperty("file.separator");
    +        String classpath = System.getProperty("java.class.path");
    +        String java = System.getProperty("java.home")
    +                + separator + "bin" + separator + "java";
    --- End diff --
    
    On windows, the java executable will end with ".exe". This should avoid any problem:
    ```java
    import org.apache.commons.lang3.SystemUtils;
            if (SystemUtils.IS_OS_WINDOWS)
                java += ".exe";
    ```


---
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 #218: JENA-1294: Don't use contants during initialization.

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

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


---
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 #218: JENA-1294: Don't use contants during initialization.

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

    https://github.com/apache/jena/pull/218#discussion_r103077077
  
    --- Diff: jena-arq/src/main/java/org/apache/jena/sparql/core/assembler/AssemblerUtils.java ---
    @@ -76,8 +76,11 @@ static public void registerModel(Resource r, Assembler a) {
         /** Register an addition assembler */  
         static public void register(AssemblerGroup g, Resource r, Assembler a, Resource superType) {
             registerAssembler(g, r, a) ;
    -        if ( superType != null && ! superType.equals(r) ) 
    -            modelExtras.add(r, RDFS.subClassOf, superType) ;
    +        if ( superType != null && ! superType.equals(r) ) {
    +            // This is called during Jena-wide initialization.
    +            // Use function for constant (JENA-1294)
    +           modelExtras.add(r, RDFS.Init.subClassOf(), superType) ;
    --- End diff --
    
    Example of use of the calculation rather than the eventual constant.


---
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.
---