Talk:Wikidata Query Service

Rendered with Parsoid
From Wikitech

[SOLVED] I'm trying to install WDQS. Errors are shown when running war/runBlazegraph.sh

The context

I've been reading the documentation in mw:Wikibase/Suite and I've already installed MediaWiki and Wikibase in my local computer, I have also been able to create items and properties using a web browser in my MediaWiki instance. Now, I want to run SPARQL queries on the items that I've created in my MediaWiki instance. For this reason, I'm following the instructions in Wikidata_Query_Service#Build (archive).

In the documentation, it is mentioned that I need to clone this Github repository. I've already clonsed it and I'm using the master branch.

$ git log -n 1

The output of the command above is shown below.

commit f26596edc03d9620558515f83245d4caab5778c1 (HEAD -> master, origin/master, origin/HEAD)
Author: Erik Bernhardson <ebernhardson@wikimedia.org>
Date:   Thu Oct 13 13:04:59 2022 -0700

    Update badservice.result query test for current output
    
    Not sure when it changed, but the output we need to be expecting for
    this query to be rejected is different than was recorded in the result
    file. Updated file to match the current output.
    
    Change-Id: Ibe3019426295129313c7e29b7d56d5f7dc9a7f67

The problem

In the documentation, it is mentioned that I need to run the following command to "build the distribution package" 1.

$ ./mvnw package

The output of the command above is shown below.

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:

(... 8855 omitted lines ...)

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Wikidata Query Service 0.3.118-SNAPSHOT:
[INFO] 
[INFO] Wikidata Query Service ............................. SUCCESS [  1.174 s]
[INFO] Shared code ........................................ SUCCESS [  3.222 s]
[INFO] Wikidata Query RDF Testing Tools ................... SUCCESS [  1.167 s]
[INFO] Jetty logging dependencies ......................... SUCCESS [  2.747 s]
[INFO] Blazegraph extension to improve performance for Wikibase SUCCESS [ 11.908 s]
[INFO] Blazegraph Service Package ......................... SUCCESS [  1.331 s]
[INFO] Wikidata Query RDF Tools ........................... SUCCESS [ 10.194 s]
[INFO] Wikidata Query Service Streaming Updater - Common .. SUCCESS [  2.182 s]
[INFO] Wikidata Query Service Streaming Updater - Producer  SUCCESS [ 44.495 s]
[INFO] Wikidata Query Service Streaming Updater - Consumer  SUCCESS [  4.406 s]
[INFO] MediaWiki OAuth 1.0a Proxy Service ................. SUCCESS [  2.635 s]
[INFO] rdf-spark-tools .................................... SUCCESS [01:19 min]
[INFO] Wikibase RDF Query Service ......................... SUCCESS [  4.028 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:49 min
[INFO] Finished at: 2022-11-06T22:53:42-05:00
[INFO] ------------------------------------------------------------------------

As you can see above, the command was successfully executed. Now, when I try to execute the command $ bash war/runBlazegraph.sh. I get the error shown below.

$ bash war/runBlazegraph.sh

The output of the command above is shown below.

[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< org.wikidata.query.rdf:tools >--------------------
[INFO] Building Wikidata Query RDF Tools 0.3.118-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> jetty-maven-plugin:9.4.12.v20180830:run (default-cli) > test-compile @ tools >>>
[WARNING] The POM for org.wikidata.query.rdf:common:jar:0.3.118-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.wikidata.query.rdf:testTools:jar:0.3.118-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.412 s
[INFO] Finished at: 2022-11-06T22:54:51-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project tools: Could not resolve dependencies for project org.wikidata.query.rdf:tools:jar:0.3.118-SNAPSHOT: The following artifacts could not be resolved: org.wikidata.query.rdf:common:jar:0.3.118-SNAPSHOT, org.wikidata.query.rdf:testTools:jar:0.3.118-SNAPSHOT: org.wikidata.query.rdf:common:jar:0.3.118-SNAPSHOT was not found in https://archiva.wikimedia.org/repository/mirrored during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of wmf.mirrored has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

I also tried running the command with the -U flag.

$ bash war/runBlazegraph.sh -U
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------< org.wikidata.query.rdf:tools >--------------------
[INFO] Building Wikidata Query RDF Tools 0.3.118-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> jetty-maven-plugin:9.4.12.v20180830:run (default-cli) > test-compile @ tools >>>
Downloading from wmf.releases: https://archiva.wikimedia.org/repository/releases/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/maven-metadata.xml
Downloading from wmf.snapshots: https://archiva.wikimedia.org/repository/snapshots/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/maven-metadata.xml
Downloading from wmf.mirrored: https://archiva.wikimedia.org/repository/mirrored/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/maven-metadata.xml
Downloading from wmf.mirrored: https://archiva.wikimedia.org/repository/mirrored/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/common-0.3.118-SNAPSHOT.pom
Downloading from wmf.releases: https://archiva.wikimedia.org/repository/releases/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/common-0.3.118-SNAPSHOT.pom
Downloading from wmf.snapshots: https://archiva.wikimedia.org/repository/snapshots/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/common-0.3.118-SNAPSHOT.pom
[WARNING] The POM for org.wikidata.query.rdf:common:jar:0.3.118-SNAPSHOT is missing, no dependency information available
Downloading from wmf.mirrored: https://archiva.wikimedia.org/repository/mirrored/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/maven-metadata.xml
Downloading from wmf.snapshots: https://archiva.wikimedia.org/repository/snapshots/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/maven-metadata.xml
Downloading from wmf.releases: https://archiva.wikimedia.org/repository/releases/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/maven-metadata.xml
Downloading from wmf.mirrored: https://archiva.wikimedia.org/repository/mirrored/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/testTools-0.3.118-SNAPSHOT.pom
Downloading from wmf.releases: https://archiva.wikimedia.org/repository/releases/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/testTools-0.3.118-SNAPSHOT.pom
Downloading from wmf.snapshots: https://archiva.wikimedia.org/repository/snapshots/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/testTools-0.3.118-SNAPSHOT.pom
[WARNING] The POM for org.wikidata.query.rdf:testTools:jar:0.3.118-SNAPSHOT is missing, no dependency information available
Downloading from wmf.mirrored: https://archiva.wikimedia.org/repository/mirrored/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/common-0.3.118-SNAPSHOT.jar
Downloading from wmf.mirrored: https://archiva.wikimedia.org/repository/mirrored/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/testTools-0.3.118-SNAPSHOT.jar
Downloading from wmf.releases: https://archiva.wikimedia.org/repository/releases/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/common-0.3.118-SNAPSHOT.jar
Downloading from wmf.releases: https://archiva.wikimedia.org/repository/releases/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/testTools-0.3.118-SNAPSHOT.jar
Downloading from wmf.snapshots: https://archiva.wikimedia.org/repository/snapshots/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/common-0.3.118-SNAPSHOT.jar
Downloading from wmf.snapshots: https://archiva.wikimedia.org/repository/snapshots/org/wikidata/query/rdf/testTools/0.3.118-SNAPSHOT/testTools-0.3.118-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  5.889 s
[INFO] Finished at: 2022-11-06T23:04:38-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project tools: Could not resolve dependencies for project org.wikidata.query.rdf:tools:jar:0.3.118-SNAPSHOT: The following artifacts could not be resolved: org.wikidata.query.rdf:common:jar:0.3.118-SNAPSHOT, org.wikidata.query.rdf:testTools:jar:0.3.118-SNAPSHOT: Could not find artifact org.wikidata.query.rdf:common:jar:0.3.118-SNAPSHOT in wmf.mirrored (https://archiva.wikimedia.org/repository/mirrored) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

The question

Could someone mention what I'm doing wrong? Pardon if I've made an obvious mistake.

Footnotes

1 I don't understand what "distribution package" means, but I assumed that it is required to run Blazegraph since it is the comand that comes before the command $ bash war/runBlazegraph.sh (revision as of the time of this writing).

Rdrg109 (talk) 21:51, 6 November 2022 (UTC) Rdrg109 (talk) 21:51, 6 November 2022 (UTC)Reply

I found the root cause of this problem: In the master branch (the branch that I used when I found that problem) the following repositories are mentioned in the file pom.xml (see source code in Github (archive)). The following list contains the URLs to the repositories that are mentioned in the references source code.
If we follow the path from which the required files (see code block where I ran the command with the -U flag) are downloaded, the files doesn't exist. For example, the command shows that it tries to download from the following URL
https://archiva.wikimedia.org/repository/mirrored/org/wikidata/query/rdf/common/0.3.118-SNAPSHOT/common-0.3.118-SNAPSHOT.jar
but none of the repositories have a directory 0.3.118-SNAPSHOT called. You can check the repositories by yourself.
I hope I have explained the problem thoroughly. I solved the problem by checking out to the tag query-service-parent-0.3.117, since I noticed that there's a directory called 0.3.117 in one of the repositories (URL) (archive)
$ git checkout query-service-parent-0.3.117
I then cleaned all the files that were not under version control, reverted all changes, and executed the command again (see three commands below)
$ git clean -f -d -x
$ git reset --hard
$ bash war/runBlazegraph.sh -U
This solved this specific error, but a new error was shown. I'll create a new topic for this new error that I found. I solved this new problem by executing $ mvn install in the Github repository. I'll create a link to the new issue when I get some time to write about it.
-- Rdrg109 (talk) 04:26, 7 November 2022 (UTC)Reply