Skip to content

Commit 6cab5c1

Browse files
authored
Merge pull request #51 from wbstack/addshore-wmde.5-update
Update to include changes created by addshore as part of wmde.5-update
2 parents 575b428 + 1b514f1 commit 6cab5c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+3783
-3263
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ updates:
55
schedule:
66
interval: daily
77
open-pull-requests-limit: 10
8-
- package-ecosystem: docker
8+
- package-ecosystem: npm
99
directory: "/"
1010
schedule:
1111
interval: daily
1212
open-pull-requests-limit: 10
13-
ignore:
14-
- dependency-name: node
15-
versions:
16-
- "15"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Dependabot to Gerrit
2+
on:
3+
pull_request_target:
4+
types: [opened, reopened, synchronize, closed]
5+
jobs:
6+
open-or-update-change:
7+
runs-on: ubuntu-latest
8+
if: github.actor == 'dependabot[bot]'
9+
steps:
10+
- name: Run dependabot gerrit action
11+
uses: wmde/dependabot-gerrit-action@main
12+
with:
13+
password: ${{ secrets.DEPENDABOT_GERRIT_PASSWORD }}
14+
user: Addbot
15+
email: addshorewiki+addbot-dependabot@gmail.com

.stylelintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"rules": {
44
"color-named": null,
55
"declaration-no-important": null,
6-
"declaration-property-value-blacklist": null,
6+
"declaration-property-unit-disallowed-list": null,
77
"no-descending-specificity": null,
88
"selector-max-id": null
99
}

Gruntfile.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ module.exports = function( grunt ) {
7272
banana: {
7373
all: 'i18n/',
7474
options: {
75-
disallowBlankTranslations: false
75+
disallowBlankTranslations: false,
76+
requireKeyPrefix: 'wdqs-'
7677
}
7778
},
7879
clean: {
@@ -179,6 +180,10 @@ module.exports = function( grunt ) {
179180
],
180181
dest: buildFolder + '/default-config.json',
181182
filter: 'isFile'
183+
},
184+
{// query builder dropdown image
185+
src: 'wikibase/queryService/ui/304px_querybuilder_final.gif',
186+
dest: buildFolder + '/',
182187
}
183188
]
184189
}
@@ -335,7 +340,7 @@ module.exports = function( grunt ) {
335340
'test', 'browser_test', 'clean', 'shell:cloneDeploy', 'clean:deploy', 'only_build'
336341
] );
337342
grunt.registerTask( 'deploy', [
338-
'build-for-deploy', 'shell:commitDeploy', 'shell:review'
343+
'build_for_deploy', 'shell:commitDeploy', 'shell:review'
339344
] );
340345
grunt.registerTask( 'security', [
341346
'clean', 'shell:cloneDeploy', 'clean:deploy', 'only_build', 'shell:commitDeploy', 'shell:formatPatchDeploy'

default-config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"urlShortener": "tinyurl",
1616
"query-builder": {
17-
"server": "https://query-builder-test.toolforge.org/"
17+
"server": "https://query.wikidata.org/querybuilder/"
1818
}
1919
},
2020
"brand": {
@@ -27,5 +27,6 @@
2727
"root": "./",
2828
"index": "./index.html"
2929
},
30+
"showBanner": false,
3031
"prefixes": {}
3132
}

dist/css/style.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/js/wdqs.min.js

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

embed.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ <h3 data-role="title" class="modal-title pull-left explorer-title">Explorer</h3>
529529
<script src="wikibase/queryService/api/Tracking.js"></script>
530530
<script src="wikibase/queryService/api/UrlShortener.js"></script>
531531
<script src="wikibase/queryService/RdfNamespaces.js"></script>
532+
<script src="wikibase/queryService/ui/Banner.js"></script>
532533
<script src="wikibase/queryService/ui/queryHelper/QueryHelper.js"></script>
533534
<script src="wikibase/queryService/ui/queryHelper/SparqlQuery.js"></script>
534535
<script src="wikibase/queryService/ui/queryHelper/SelectorBox.js"></script>

examples/code/Java.txt

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,29 @@
1-
// https://github.com/BorderCloud/SPARQL-JAVA
2-
import com.bordercloud.sparql.Endpoint;
3-
import com.bordercloud.sparql.EndpointException;
4-
import java.util.ArrayList;
5-
import java.util.HashMap;
1+
// https://github.com/eclipse/rdf4j
2+
import org.eclipse.rdf4j.query.resultio.sparqljson.SPARQLResultsJSONWriter;
3+
import org.eclipse.rdf4j.repository.RepositoryException;
4+
import org.eclipse.rdf4j.repository.sparql.SPARQLRepository;
5+
import java.util.Collections;
66

7-
public class Main {
7+
/**
8+
* Wikidata RDF4J SPARQL example
9+
*/
10+
public class App
11+
{
12+
public static void main( String[] args )
13+
{
14+
String sparqlEndpoint = "{ENDPOINT_URL}";
15+
SPARQLRepository repo = new SPARQLRepository(sparqlEndpoint);
816

9-
public static void main(String[] args) {
10-
String endpointUrl = "{ENDPOINT_URL}";
17+
String userAgent = "Wikidata RDF4J Java Example/0.1 (https://query.wikidata.org/)";
18+
repo.setAdditionalHttpHeaders( Collections.singletonMap("User-Agent", userAgent ) );
1119

1220
String querySelect = {SPARQL_QUERY};
1321

14-
try {
15-
HashMap data = retrieveData(endpointUrl, querySelect);
16-
printResult(data, 30);
17-
} catch (EndpointException eex) {
18-
eex.printStackTrace();
22+
try{
23+
repo.getConnection().prepareTupleQuery(querySelect).evaluate(new SPARQLResultsJSONWriter(System.out));
24+
} catch ( Exception exception ) {
25+
exception.printStackTrace();
1926
}
20-
}
21-
22-
public static HashMap<String, HashMap> retrieveData(String endpointUrl, String query) throws EndpointException {
23-
Endpoint sp = new Endpoint(endpointUrl, false);
24-
sp.setUserAgentRequestHeader("WDQS-Example Java"); // TODO adjust this; see https://w.wiki/CX6
25-
HashMap<String, HashMap> rs = sp.query(query);
26-
return rs;
27-
}
2827

29-
public static void printResult(HashMap<String, HashMap> rs , int size) {
30-
for (String variable : (ArrayList<String>) rs.get("result").get("variables")) {
31-
System.out.print(String.format("%-"+size+"."+size+"s", variable ) + " | ");
32-
}
33-
System.out.print("\n");
34-
for (HashMap value : (ArrayList<HashMap>) rs.get("result").get("rows")) {
35-
for (String variable : (ArrayList<String>) rs.get("result").get("variables")) {
36-
System.out.print(String.format("%-"+size+"."+size+"s", value.get(variable)) + " | ");
37-
}
38-
System.out.print("\n");
39-
}
4028
}
41-
}
29+
}

i18n/ab.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"@metadata": {
33
"authors": [
4+
"Fraxinus.cs",
45
"Pupsik-ipa",
56
"Андрей"
67
]
@@ -25,7 +26,7 @@
2526
"wdqs-app-result-csv": "CSV-афаил",
2627
"wdqs-dialog-examples-preview-result": "Иахәаԥштәуп алҵшәа",
2728
"wdqs-dialog-key-shortcut-close-button": "Иарктәуп",
28-
"wdqs-ve-filter": "Афильтр",
29+
"wdqs-ve-filter": "Араӡага",
2930
"wdqs-ve-show": "Иаарԥштәуп",
3031
"wdqs-ve-or": "ма",
3132
"wdqs-ve-sb-other": "Даҽакы",

0 commit comments

Comments
 (0)