Skip to content

405 (Method not allowed) for SELECT QUERY with # street address in comment #232

@WolfgangFahl

Description

@WolfgangFahl

see WolfgangFahl/pyLoDStorage#119

When sending the query

# Count all Q44613:monastery items
# with the given street address(P6375) https://www.wikidata.org/wiki/Property:P6375 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http://schema.org/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT ?count (COUNT(?count) AS ?frequency) WHERE {{
SELECT ?item ?itemLabel (COUNT (?value) AS ?count)
WHERE
{
  # instance of monastery
  ?item wdt:P31 wd:Q44613.
  ?item rdfs:label ?itemLabel.
  FILTER (LANG(?itemLabel) = "en").
  # street address
  ?item wdt:P6375 ?value.
} GROUP BY ?item ?itemLabel

}}
GROUP BY ?count
ORDER BY DESC (?frequency)

try it!

with SPARQLWrapper 1.8.5 and 2.0.0 the query is interpreted as an ADD query since the _parseQueryType and def _cleanComments functions don't handle this case appropriately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions