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










0















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+










share|improve this question







New contributor




belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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
















0















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+










share|improve this question







New contributor




belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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














0












0








0








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+










share|improve this question







New contributor




belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












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






share|improve this question







New contributor




belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question







New contributor




belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question






New contributor




belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









bellebelle

43




43




New contributor




belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






belle is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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


















  • 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

















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













1 Answer
1






active

oldest

votes


















2














To eliminate duplicate rows --



SELECT ?event ?eventLabel


-- should be made --



SELECT DISTINCT ?event ?eventLabel





share|improve this answer






















    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.









    draft saved

    draft discarded


















    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









    2














    To eliminate duplicate rows --



    SELECT ?event ?eventLabel


    -- should be made --



    SELECT DISTINCT ?event ?eventLabel





    share|improve this answer



























      2














      To eliminate duplicate rows --



      SELECT ?event ?eventLabel


      -- should be made --



      SELECT DISTINCT ?event ?eventLabel





      share|improve this answer

























        2












        2








        2







        To eliminate duplicate rows --



        SELECT ?event ?eventLabel


        -- should be made --



        SELECT DISTINCT ?event ?eventLabel





        share|improve this answer













        To eliminate duplicate rows --



        SELECT ?event ?eventLabel


        -- should be made --



        SELECT DISTINCT ?event ?eventLabel






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        TallTedTallTed

        6,52621527




        6,52621527






















            belle is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

            2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

            Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme