Why am I getting duplicates in results? (DBpedia sparql query)2019 Community Moderator ElectionSPARQL query with COUNT and ORDER returns odd resultHow to query dbpedia resource ontology 'wikiPageExternalLink'What is the correct SPARQL version for this query?SPARQL query to get skos:broader property of a dbpedia categorySPARQL in DBpedia return no resultsSPARQL: extract distinct values from dbpediaEasyRDF - SPARQL querying DBpedia - “Undefined namespace prefix” errorSame SPARQL query gives different resultsSPARQL query returns different results depending on the order of statementsComma error while searching on SPARQL, DBpedia
Named nets not connected in Eagle board design
A bug in Excel? Conditional formatting for marking duplicates also highlights unique value
How spaceships determine each other's mass in space?
How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?
Why do phishing e-mails use faked e-mail addresses instead of the real one?
ESPP--any reason not to go all in?
Can inspiration allow the Rogue to make a Sneak Attack?
The need of reserving one's ability in job interviews
Should I use HTTPS on a domain that will only be used for redirection?
Naming Characters after Friends/Family
Affine transformation of circular arc in 3D
Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?
Paper published similar to PhD thesis
Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?
School performs periodic password audits. Is my password compromised?
Why do we call complex numbers “numbers” but we don’t consider 2 vectors numbers?
Computing the volume of a simplex-like object with constraints
Has a sovereign Communist government ever run, and conceded loss, on a fair election?
Are Wave equations equivalent to Maxwell equations in free space?
Why aren't there more gauls like Obelix?
What is "desert glass" and what does it do to the PCs?
An Undercover Army
Do natural melee weapons (from racial traits) trigger Improved Divine Smite?
Short story about an infectious indestructible metal bar?
Why am I getting duplicates in results? (DBpedia sparql query)
2019 Community Moderator ElectionSPARQL query with COUNT and ORDER returns odd resultHow to query dbpedia resource ontology 'wikiPageExternalLink'What is the correct SPARQL version for this query?SPARQL query to get skos:broader property of a dbpedia categorySPARQL in DBpedia return no resultsSPARQL: extract distinct values from dbpediaEasyRDF - SPARQL querying DBpedia - “Undefined namespace prefix” errorSame SPARQL query gives different resultsSPARQL query returns different results depending on the order of statementsComma error while searching on SPARQL, DBpedia
I thought I was querying fine until I saw the result had some same events appearing a few times. Could anyone explain why?
Query:
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?event ?eventLabel
WHERE
?event a dbo:MilitaryConflict ;
dbo:date ?date .
FILTER ( ?date >= "1918-01-01"^^xsd:date && ?date <= "2018-12-31"^^xsd:date ).
FILTER(LANG(?eventLabel) = "nl").
OPTIONAL ?event rdfs:label ?eventLabel.
Result:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX++dbo%3A++%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0A%0D%0A%23SELECT+++++%28+COUNT+%28DISTINCT+%3Fevent%29+AS+%3Fcnt+%29%0D%0ASELECT+%3Fevent+%3FeventLabel%0D%0A%0D%0AWHERE%0D%0A++%7B+%3Fevent++a+++++++++++++dbo%3AMilitaryConflict+%3B%0D%0A++++dbo%3Adate++%3Fdate+++.%0D%0A%0D%0A++++FILTER+%28+%3Fdate+%3E%3D+%221918-01-01%22%5E%5Exsd%3Adate+%26%26+%3Fdate+%3C%3D+%222018-12-31%22%5E%5Exsd%3Adate+%29.%0D%0A++++FILTER%28LANG%28%3FeventLabel%29+%3D+%22nl%22%29.%0D%0A+++OPTIONAL+%7B+%3Fevent+rdfs%3Alabel+%3FeventLabel.%7D%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on&run=+Run+Query+
sparql dbpedia
New contributor
|
show 7 more comments
I thought I was querying fine until I saw the result had some same events appearing a few times. Could anyone explain why?
Query:
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?event ?eventLabel
WHERE
?event a dbo:MilitaryConflict ;
dbo:date ?date .
FILTER ( ?date >= "1918-01-01"^^xsd:date && ?date <= "2018-12-31"^^xsd:date ).
FILTER(LANG(?eventLabel) = "nl").
OPTIONAL ?event rdfs:label ?eventLabel.
Result:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX++dbo%3A++%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0A%0D%0A%23SELECT+++++%28+COUNT+%28DISTINCT+%3Fevent%29+AS+%3Fcnt+%29%0D%0ASELECT+%3Fevent+%3FeventLabel%0D%0A%0D%0AWHERE%0D%0A++%7B+%3Fevent++a+++++++++++++dbo%3AMilitaryConflict+%3B%0D%0A++++dbo%3Adate++%3Fdate+++.%0D%0A%0D%0A++++FILTER+%28+%3Fdate+%3E%3D+%221918-01-01%22%5E%5Exsd%3Adate+%26%26+%3Fdate+%3C%3D+%222018-12-31%22%5E%5Exsd%3Adate+%29.%0D%0A++++FILTER%28LANG%28%3FeventLabel%29+%3D+%22nl%22%29.%0D%0A+++OPTIONAL+%7B+%3Fevent+rdfs%3Alabel+%3FeventLabel.%7D%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on&run=+Run+Query+
sparql dbpedia
New contributor
You should already know the purpose of theDISTINCT
operator given that you used it already in previous queries ... and if you ask why, that's the nature of SPARQL, it returns a single "row" for each matching combination. Look at some of the events, they have multiple dates, thus, there are multiple RDF triple that match the query.
– AKSW
yesterday
Shorter answer,SELECT DISTINCT ...
– AKSW
yesterday
By the way, you won't find any event of 2017 and 2018 at this SPARQL endpoint.
– AKSW
yesterday
1
OH thanks! :D Fog is off my head now. Obviously I was using DISTINCT for count, but not for this query.
– belle
yesterday
Okay :) Do you have any clue why events.dbpedia.org/sparql won't work, though? I checked it for 2 weeks, and it's always offline. But it shouldn't matter that I query on dbpedia.org/sparql here instead, right...? Sorry for all the silly questions :D
– belle
yesterday
|
show 7 more comments
I thought I was querying fine until I saw the result had some same events appearing a few times. Could anyone explain why?
Query:
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?event ?eventLabel
WHERE
?event a dbo:MilitaryConflict ;
dbo:date ?date .
FILTER ( ?date >= "1918-01-01"^^xsd:date && ?date <= "2018-12-31"^^xsd:date ).
FILTER(LANG(?eventLabel) = "nl").
OPTIONAL ?event rdfs:label ?eventLabel.
Result:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX++dbo%3A++%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0A%0D%0A%23SELECT+++++%28+COUNT+%28DISTINCT+%3Fevent%29+AS+%3Fcnt+%29%0D%0ASELECT+%3Fevent+%3FeventLabel%0D%0A%0D%0AWHERE%0D%0A++%7B+%3Fevent++a+++++++++++++dbo%3AMilitaryConflict+%3B%0D%0A++++dbo%3Adate++%3Fdate+++.%0D%0A%0D%0A++++FILTER+%28+%3Fdate+%3E%3D+%221918-01-01%22%5E%5Exsd%3Adate+%26%26+%3Fdate+%3C%3D+%222018-12-31%22%5E%5Exsd%3Adate+%29.%0D%0A++++FILTER%28LANG%28%3FeventLabel%29+%3D+%22nl%22%29.%0D%0A+++OPTIONAL+%7B+%3Fevent+rdfs%3Alabel+%3FeventLabel.%7D%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on&run=+Run+Query+
sparql dbpedia
New contributor
I thought I was querying fine until I saw the result had some same events appearing a few times. Could anyone explain why?
Query:
PREFIX dbo: <http://dbpedia.org/ontology/>
SELECT ?event ?eventLabel
WHERE
?event a dbo:MilitaryConflict ;
dbo:date ?date .
FILTER ( ?date >= "1918-01-01"^^xsd:date && ?date <= "2018-12-31"^^xsd:date ).
FILTER(LANG(?eventLabel) = "nl").
OPTIONAL ?event rdfs:label ?eventLabel.
Result:
http://dbpedia.org/sparql?default-graph-uri=http%3A%2F%2Fdbpedia.org&query=PREFIX++dbo%3A++%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0A%0D%0A%23SELECT+++++%28+COUNT+%28DISTINCT+%3Fevent%29+AS+%3Fcnt+%29%0D%0ASELECT+%3Fevent+%3FeventLabel%0D%0A%0D%0AWHERE%0D%0A++%7B+%3Fevent++a+++++++++++++dbo%3AMilitaryConflict+%3B%0D%0A++++dbo%3Adate++%3Fdate+++.%0D%0A%0D%0A++++FILTER+%28+%3Fdate+%3E%3D+%221918-01-01%22%5E%5Exsd%3Adate+%26%26+%3Fdate+%3C%3D+%222018-12-31%22%5E%5Exsd%3Adate+%29.%0D%0A++++FILTER%28LANG%28%3FeventLabel%29+%3D+%22nl%22%29.%0D%0A+++OPTIONAL+%7B+%3Fevent+rdfs%3Alabel+%3FeventLabel.%7D%7D&format=text%2Fhtml&CXML_redir_for_subjs=121&CXML_redir_for_hrefs=&timeout=30000&debug=on&run=+Run+Query+
sparql dbpedia
sparql dbpedia
New contributor
New contributor
New contributor
asked yesterday
bellebelle
43
43
New contributor
New contributor
You should already know the purpose of theDISTINCT
operator given that you used it already in previous queries ... and if you ask why, that's the nature of SPARQL, it returns a single "row" for each matching combination. Look at some of the events, they have multiple dates, thus, there are multiple RDF triple that match the query.
– AKSW
yesterday
Shorter answer,SELECT DISTINCT ...
– AKSW
yesterday
By the way, you won't find any event of 2017 and 2018 at this SPARQL endpoint.
– AKSW
yesterday
1
OH thanks! :D Fog is off my head now. Obviously I was using DISTINCT for count, but not for this query.
– belle
yesterday
Okay :) Do you have any clue why events.dbpedia.org/sparql won't work, though? I checked it for 2 weeks, and it's always offline. But it shouldn't matter that I query on dbpedia.org/sparql here instead, right...? Sorry for all the silly questions :D
– belle
yesterday
|
show 7 more comments
You should already know the purpose of theDISTINCT
operator given that you used it already in previous queries ... and if you ask why, that's the nature of SPARQL, it returns a single "row" for each matching combination. Look at some of the events, they have multiple dates, thus, there are multiple RDF triple that match the query.
– AKSW
yesterday
Shorter answer,SELECT DISTINCT ...
– AKSW
yesterday
By the way, you won't find any event of 2017 and 2018 at this SPARQL endpoint.
– AKSW
yesterday
1
OH thanks! :D Fog is off my head now. Obviously I was using DISTINCT for count, but not for this query.
– belle
yesterday
Okay :) Do you have any clue why events.dbpedia.org/sparql won't work, though? I checked it for 2 weeks, and it's always offline. But it shouldn't matter that I query on dbpedia.org/sparql here instead, right...? Sorry for all the silly questions :D
– belle
yesterday
You should already know the purpose of the
DISTINCT
operator given that you used it already in previous queries ... and if you ask why, that's the nature of SPARQL, it returns a single "row" for each matching combination. Look at some of the events, they have multiple dates, thus, there are multiple RDF triple that match the query.– AKSW
yesterday
You should already know the purpose of the
DISTINCT
operator given that you used it already in previous queries ... and if you ask why, that's the nature of SPARQL, it returns a single "row" for each matching combination. Look at some of the events, they have multiple dates, thus, there are multiple RDF triple that match the query.– AKSW
yesterday
Shorter answer,
SELECT DISTINCT ...
– AKSW
yesterday
Shorter answer,
SELECT DISTINCT ...
– AKSW
yesterday
By the way, you won't find any event of 2017 and 2018 at this SPARQL endpoint.
– AKSW
yesterday
By the way, you won't find any event of 2017 and 2018 at this SPARQL endpoint.
– AKSW
yesterday
1
1
OH thanks! :D Fog is off my head now. Obviously I was using DISTINCT for count, but not for this query.
– belle
yesterday
OH thanks! :D Fog is off my head now. Obviously I was using DISTINCT for count, but not for this query.
– belle
yesterday
Okay :) Do you have any clue why events.dbpedia.org/sparql won't work, though? I checked it for 2 weeks, and it's always offline. But it shouldn't matter that I query on dbpedia.org/sparql here instead, right...? Sorry for all the silly questions :D
– belle
yesterday
Okay :) Do you have any clue why events.dbpedia.org/sparql won't work, though? I checked it for 2 weeks, and it's always offline. But it shouldn't matter that I query on dbpedia.org/sparql here instead, right...? Sorry for all the silly questions :D
– belle
yesterday
|
show 7 more comments
1 Answer
1
active
oldest
votes
To eliminate duplicate rows --
SELECT ?event ?eventLabel
-- should be made --
SELECT DISTINCT ?event ?eventLabel
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
belle is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023133%2fwhy-am-i-getting-duplicates-in-results-dbpedia-sparql-query%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
To eliminate duplicate rows --
SELECT ?event ?eventLabel
-- should be made --
SELECT DISTINCT ?event ?eventLabel
add a comment |
To eliminate duplicate rows --
SELECT ?event ?eventLabel
-- should be made --
SELECT DISTINCT ?event ?eventLabel
add a comment |
To eliminate duplicate rows --
SELECT ?event ?eventLabel
-- should be made --
SELECT DISTINCT ?event ?eventLabel
To eliminate duplicate rows --
SELECT ?event ?eventLabel
-- should be made --
SELECT DISTINCT ?event ?eventLabel
answered yesterday
TallTedTallTed
6,52621527
6,52621527
add a comment |
add a comment |
belle is a new contributor. Be nice, and check out our Code of Conduct.
belle is a new contributor. Be nice, and check out our Code of Conduct.
belle is a new contributor. Be nice, and check out our Code of Conduct.
belle is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55023133%2fwhy-am-i-getting-duplicates-in-results-dbpedia-sparql-query%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You should already know the purpose of the
DISTINCT
operator given that you used it already in previous queries ... and if you ask why, that's the nature of SPARQL, it returns a single "row" for each matching combination. Look at some of the events, they have multiple dates, thus, there are multiple RDF triple that match the query.– AKSW
yesterday
Shorter answer,
SELECT DISTINCT ...
– AKSW
yesterday
By the way, you won't find any event of 2017 and 2018 at this SPARQL endpoint.
– AKSW
yesterday
1
OH thanks! :D Fog is off my head now. Obviously I was using DISTINCT for count, but not for this query.
– belle
yesterday
Okay :) Do you have any clue why events.dbpedia.org/sparql won't work, though? I checked it for 2 weeks, and it's always offline. But it shouldn't matter that I query on dbpedia.org/sparql here instead, right...? Sorry for all the silly questions :D
– belle
yesterday