Wikidata:WikiProject Sailing/Queries
Queries related to Boat Manufacturing Companies
editLists related to boat manufacturing companies |
---|
List of all boat manufacturing companieseditList all instances and sub-classes of boat manufacturing company (Q73126803) PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?item ?itemLabel ?desc ?USCG_MIC ?inception ?founderLabel ?ceoLabel ?product ?productLabel ?headquarterLabel
WHERE
{
?item wdt:P31/wdt:P279* wd:Q73126803 .
?item schema:description ?desc.
OPTIONAL {?item wdt:P9411 ?USCG_MIC .}
OPTIONAL {?item wdt:P571 ?inception .}
OPTIONAL {?item wdt:P112 ?founder .}
OPTIONAL {?item wdt:P169 ?ceo .}
OPTIONAL {?item wdt:P1056 ?product .}
OPTIONAL {?item wdt:P159 ?headquarter .}
FILTER ( lang(?desc) = "en" )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Editable list of all boat manufacturing companieseditTABernacle list of all boat manufacturing companies: editable list |
Queries related to Sailboat Classes
editLists related to sailboat classes |
---|
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?sailboat_class ?sailboat_classLabel ?desc
WHERE
{
?sailboat_class wdt:P31 wd:Q106179098 .
OPTIONAL{
?sailboat_class schema:description ?desc.
FILTER ( lang(?desc) = "en" )
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
sailboat class (Q106179098) items with beam (P2261)editPREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?sailboat ?sailboatLabel ?desc ?beam
WHERE
{
?sailboat wdt:P31 wd:Q106179098 .
?sailboat wdt:P2261 ?beam .
?sailboat schema:description ?desc.
FILTER ( lang(?desc) = "en" )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?sailboat ?sailboatLabel ?desc ?property ?qualifierLabel
WHERE
{
?sailboat wdt:P31 wd:Q106179098 .
?sailboat wdt:P2043 ?property .
?sailboat schema:description ?desc .
?sailboat p:P2043 [ps:P2043 ?property;
pq:P642 ?qualifier;
pq:P642 wd:Q1817392;
].
FILTER ( lang(?desc) = "en" )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
sailboat class (Q106179098) items with length (P2043) converted to standard SI unitedit# sailboat class lengths converted to standard SI unit
# see https://en.wikibooks.org/wiki/SPARQL/WIKIDATA_Precision,_Units_and_Coordinates#Normalised_units
SELECT ?item ?itemLabel ?length ?unitLabel ?length2 ?conversion ?length_in_m
WHERE
{
?item wdt:P31/wdt:P279* wd:Q106179098. # sailboat class
#?item wdt:P17 wd:Q30. # country USA
?item p:P2043 ?stmnode. # length
?stmnode psv:P2043 ?valuenode.
?valuenode wikibase:quantityAmount ?length.
?valuenode wikibase:quantityUnit ?unit.
# conversion to SI unit
?unit p:P2370 ?unitstmnode. # conversion to SI unit
?unitstmnode psv:P2370 ?unitvaluenode.
?unitvaluenode wikibase:quantityAmount ?conversion.
?unitvaluenode wikibase:quantityUnit wd:Q11573. # meter
BIND(?length * ?conversion AS ?length_in_m).
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?length_in_m)
LIMIT 10000
Find Sailboat items that should be Sailboat class itemseditSearch all sailboat (Q1075310) with a description containing "sailboat class" so that we can use Help:QuickStatements to replace instance of (P31) sailboat (Q1075310) by sailboat class (Q106179098) PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?sailboat ?sailboatLabel ?desc
WHERE
{
?sailboat wdt:P31 wd:Q1075310.
?sailboat schema:description ?desc.
FILTER ( lang(?desc) = "en" )
FILTER CONTAINS (?desc,"sailboat class")
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Sailboat line -> Sailboat classeditSearch all sailboat class (Q57303455) so that we can use Help:QuickStatements to replace instance of (P31) sailboat class (Q57303455) by sailboat class (Q106179098) PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?sailboat ?sailboatLabel ?desc
WHERE
{
?sailboat wdt:P31/wdt:P279* wd:Q57303455.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
|
Tools related to sailboat classes |
---|
Harvest Wikipedia templateseditHarvest Templates is a bot that imports statements into Wikidata from Wikipedia Templates (Infobox for instance) Check 'do not load items with property set' to avoid adding a statements if there is already one. Test on a 'manual list' of QID first.
Wikipedia templates parameterseditTemplate Parameters Tool lists all the parameters used by a given For instance here are all the parameters for Infobox_sailboat_specifications. Identify Wikipedia Sailboat class articles without a corresponding Wikidata entryeditRun this PetScan query to identify Wikipedia Sailboat class articles without a corresponding Wikidata entry Then use 'check all', add "P31:Q106179098" to create a statement instance of (P31) sailboat class (Q106179098) and 'Start QS' to prepare a QuickStatements batch. You have to be logged in QuickStatements to be able to click 'run' at the bottom left. |
Graphs related to sailboat classes |
---|
Graph of Sailboat class instanceseditGraph of sailboat class (Q106179098) instance of (P31)
|
Editable list of a given sailboat class |
---|
Editable list of a given sailboat classeditTABernacle list of a sailboat class: editable list of all J/92 sailboats |
Map of all J/92 and J/92s home ports |
---|
Map of all J92 and J92s home portseditBased on the SPARQL query example Map and list of municipalities in The Netherlands Replace Q97170629 / Q97179551 by a boat class to get a map of that boat class. #Map of all J/92 (Q97170629) and J/92s (Q97179551) home ports (P504)
#boat = wikidata item id (qid)
#home_portLabel = home port name
#home_port_coord = home port coordinates
#boatLabel = wikidata item name
#boat_name (optional) = boat name
#image (optional) = picture
#defaultView:Map
SELECT DISTINCT ?boat ?boatLabel ?boat_name ?instance_ofLabel ?home_portLabel ?image ?home_port_coord WHERE {
{
?boat wdt:P31/wdt:P279* wd:Q97170629; #'?boat' are 'instance of'(P31) and any number of 'subclass of' (P279*) of 'J/92'(Q97170629)
wdt:P31 ?instance_of. #'?boat' 'instance of' (P31) are '?instance_of'
}
UNION
{
?boat wdt:P31/wdt:P279* wd:Q97179551; #'?boat' are 'instance of'(P31) and any number of 'subclass of' (P279*) of 'J/92s'(Q97179551)
wdt:P31 ?instance_of. #'?boat' 'instance of' (P31) are '?instance_of'
}
OPTIONAL {
?boat wdt:P504 ?home_port . #'?boat' 'home port' (P504) are '?home_port'
#filter out home ports that are no longer current (home port (P504) with an 'end time' qualifier (P582))
?boat p:P504 ?statement1 .
?statement1 ps:P504 ?home_port .
FILTER NOT EXISTS { ?statement1 pq:P582 ?x }
?home_port wdt:P625 ?home_port_coord. #'?home_port' 'coordinate location' (P625) are '?home_port_coord'
}
OPTIONAL { ?boat wdt:P18 ?image . }
#'?boat" 'short name' (P1813) are '?boat_name'
#filter out names that are no longer current (short name (P1813) with an 'end time' qualifier (P582))
OPTIONAL {
?boat wdt:P1813 ?boat_name.
?boat p:P1813 ?statement2 .
?statement2 ps:P1813 ?boat_name .
FILTER NOT EXISTS { ?statement2 pq:P582 ?x }
}
#xxxLabel is the label for any variable called xxx
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
|
Queries related to Individual Sailboats
editLists related to individual sailboats |
---|
List of all sailboatseditList all instances and sub-classes of sailboat (Q1075310) PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?sailboat ?sailboatLabel ?desc
WHERE
{
?sailboat wdt:P31/wdt:P279* wd:Q1075310.
?sailboat schema:description ?desc.
FILTER ( lang(?desc) = "en" )
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
|
Images of sailboats |
---|
Images of sailboatseditSPARQL Query to view images of sailboats #ImageGrid of all sailboats (Q1075310)
#boat = wikidata item id (qid)
#boatLabel = wikidata item name
#home_portLabel (optional) = home port name
#boat_name (optional) = boat name
#image (optional) = picture
#defaultView:ImageGrid
SELECT DISTINCT ?boat ?boatLabel ?boat_name ?instance_ofLabel ?home_portLabel ?image WHERE {
?boat wdt:P31/wdt:P279* wd:Q1075310; #'?boat' are 'instance of'(P31) and any number of 'subclass of' (P279*) of 'sailboat'(Q1075310)
wdt:P31 ?instance_of. #'?boat' 'instance of' (P31) are '?instance_of'
OPTIONAL { ?boat wdt:P18 ?image . }
#'?boat' 'home port' (P504) are '?home_port'
OPTIONAL {
?boat wdt:P504 ?home_port .
#filter out home ports that are no longer current (home port (P504) with an 'end time' qualifier (P582))
?boat p:P504 ?statement1 .
?statement1 ps:P504 ?home_port .
FILTER NOT EXISTS { ?statement1 pq:P582 ?x }
?home_port wdt:P625 ?home_port_coord. #'?home_port' 'coordinate location' (P625) are '?home_port_coord'
}
#'?boat" 'short name' (P1813) are '?boat_name'
OPTIONAL {
?boat wdt:P1813 ?boat_name.
#filter out names that are no longer current (short name (P1813) with an 'end time' qualifier (P582))
?boat p:P1813 ?statement2 .
?statement2 ps:P1813 ?boat_name .
FILTER NOT EXISTS { ?statement2 pq:P582 ?x }
}
#xxxLabel is the label for any variable called xxx
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
|
Map of sailboats home ports |
---|
Map of sailboats home portseditBased on the SPARQL query example Map and list of municipalities in The Netherlands Replace Q1075310 by a boat class to get a map of that boat class.
#Map of all sailboat (Q1075310) home ports (P504)
#boat = wikidata item id (qid)
#home_portLabel = home port name
#home_port_coord = home port coordinates
#boatLabel = wikidata item name
#boat_name (optional) = boat name
#image (optional) = picture
#defaultView:Map
SELECT DISTINCT ?boat ?boatLabel ?boat_name ?instance_ofLabel ?home_portLabel ?image ?home_port_coord WHERE {
?boat wdt:P31/wdt:P279* wd:Q1075310; #'?boat' are 'instance of'(P31) and any number of 'subclass of' (P279*) of 'sailboat'(Q1075310)
wdt:P31 ?instance_of; #'?boat' 'instance of' (P31) are '?instance_of'
wdt:P504 ?home_port . #'?boat' 'home port' (P504) are '?home_port'
#filter out home ports that are no longer current (home port (P504) with an 'end time' qualifier (P582))
?boat p:P504 ?statement1 .
?statement1 ps:P504 ?home_port .
FILTER NOT EXISTS { ?statement1 pq:P582 ?x }
?home_port wdt:P625 ?home_port_coord. #'?home_port' 'coordinate location' (P625) are '?home_port_coord'
OPTIONAL { ?boat wdt:P18 ?image . }
#'?boat" 'short name' (P1813) are '?boat_name'
#filter out names that are no longer current (short name (P1813) with an 'end time' qualifier (P582))
OPTIONAL {
?boat wdt:P1813 ?boat_name.
?boat p:P1813 ?statement2 .
?statement2 ps:P1813 ?boat_name .
FILTER NOT EXISTS { ?statement2 pq:P582 ?x }
}
#xxxLabel is the label for any variable called xxx
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
|