Property talk:P3096

From Wikidata
Jump to navigation Jump to search

Documentation

KML file
item with sitelinks to wikimedia page containing text of a relevant KML file
RepresentsWikimedia KML file (Q26267864)
Has qualitycomplex constraint value label (Q100884525)
Data typeItem
Domain
According to this template:

Geographic features, including:

According to statements in the property:
geographic location (Q2221906), geographical feature (Q618123), thoroughfare (Q83620), railway (Q22667), itinerary (Q1322323), transport service itinerary (Q1067164), Wikimedia list article (Q13406463), Wikimedia disambiguation page (Q4167410), public transport network (Q18325841) or Wikipedia article covering multiple topics (Q21484471)
When possible, data should only be stored as statements
Allowed valuesinstance of (P31): Wikimedia KML file (Q26267864) (note: this should be moved to the property statements)
ExampleGreat Eastern Highway (Q1544264)Template:Attached KML/Great Eastern Highway (Q26267859)
SourceTransclusions of Template:Attached KML (Q6690822) (around 9600 transclusions on English Wikipedia) (note: this information should be moved to a property statement; use property source website for the property (P1896))
Tracking: usageCategory:Pages using Wikidata property P3096 (Q98093999)
See alsocoordinate location (P625), OpenStreetMap relation ID (P402), geoshape (P3896)
Lists
Proposal discussionProposal discussion
Current uses
Total11,155
Main statement11,154>99.9% of uses
Qualifier1<0.1% of uses
Search for values
Explanations [Edit]

Background[edit]

See also Meta:KML files.

Currently, Keyhole Markup Language (Q79587) files cannot be uploaded to Wikimedia Commons (Q565), or any other wiki (see Phab:T28059). As a work-around, the contents of KML file are stored as wikitext on a subpage of template Template:Attached KML (Q6690822). That template is used to generate links in an article to download the file, or view on a web-based mapping provider, using the raw version of the subpage containing the KML.

Use-cases[edit]

Through this property, Template:Attached KML (Q6690822), and Module:Attached KML (Q26689774), any wiki can access the article's KML file, regardless of which wiki it is on, through the following sequence:

  • Article item → KML file (P3096) → KML file item → sitelink to KML file (can get the URL to the raw KML file from the sitelink)
Example: Great Eastern Highway (Q1544264)KML file (P3096)Template:Attached KML/Great Eastern Highway (Q26267859)→sitelink: enwikiTemplate:Attached KML/Great Eastern Highway, thus the raw kml file is at https://en.wikipedia.org/w/index.php?title=Template:Attached_KML/Great_Eastern_Highway&action=raw
Value type “Wikimedia KML file (Q26267864): This property should use items as value that contain property “instance of (P31)”. On these, the value for instance of (P31) should be an item that uses subclass of (P279) with value Wikimedia KML file (Q26267864) (or a subclass thereof). (Help)
List of violations of this constraint: Database reports/Constraint violations/P3096#Value type Q26267864, hourly updated report, SPARQL
Single value: this property generally contains a single value. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3096#Single value, SPARQL
Conflicts with “instance of (P31): human (Q5), Wikimedia category (Q4167836): this property must not be used with the listed properties and values. (Help)
List of violations of this constraint: Database reports/Constraint violations/P3096#Conflicts with P31, hourly updated report, SPARQL
Scope is as main value (Q54828448): the property must be used by specified way only (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3096#Scope, SPARQL
Distinct values: this property likely contains a value that is different from all other items. (Help)
Exceptions are possible as rare values may exist. Exceptions can be specified using exception to constraint (P2303).
List of violations of this constraint: Database reports/Constraint violations/P3096#Unique value, SPARQL (every item), SPARQL (by value)
Item likely to be linked from this property
FIXME: add P3096 to the relevant item and link the item listed or define exceptions (Help)
Violations query: SELECT ?item { ?item wdt:P31 wd:Q26267864 MINUS { [] wdt:P3096 ?item } FILTER ( ?item not in ( wd:Q4115189,wd:Q13406268,wd:Q15397819 ) ) }
List of this constraint violations: Database reports/Complex constraint violations/P3096#Item likely to be linked from this property
value label (1: should match regex)
fix label or adjust regex for language at Property:P3096#P1552: complex constraint value label (Q100884525) (Help)
Violations query: SELECT ?item ?lang ?l ?value ?v ?t WHERE { hint:Query hint:optimizer "None". wd:P3096 p:P1552 [ ps:P1552 wd:Q100884525 ; pq:P8770 ?t ] BIND( lang(?t) as ?lang) ?item wdt:P3096 ?value. OPTIONAL { ?item rdfs:label ?l . FILTER(lang(?l) = ?lang) } ?value rdfs:label ?v . FILTER(lang(?v) = ?lang) FILTER ( !REGEX(str(?v), str(?t) ) ) } # ORDER BY ?lang ?v
List of this constraint violations: Database reports/Complex constraint violations/P3096#value label (1: should match regex)
value label (1: languages lacking a regex)
determine a regex and add it at Property:P3096#P1552: complex constraint value label (Q100884525) (Help)
Violations query: SELECT ?item ?lang (COUNT(*) as ?count) (SAMPLE(?l) as ?sample_l) (SAMPLE(?s) as ?sample_s) (SAMPLE(?value) as ?sample_value) WHERE { hint:Query hint:optimizer "None". ?s wdt:P3096 ?value . ?value rdfs:label ?l . BIND(lang(?l) as ?lang) OPTIONAL { wd:P3096 p:P1552 [ ps:P1552 wd:Q100884525 ; pq:P8770 ?t ] FILTER( lang(?t) = ?lang) } FILTER( !BOUND(?t) ) ?item wdt:P424 ?lang ; wdt:P305 [] . } GROUP BY ?item ?lang HAVING ( ?count > 9) ORDER BY DESC ( ?count)
List of this constraint violations: Database reports/Complex constraint violations/P3096#value label (1: languages lacking a regex)
This property is being used by:

Please notify projects that use this property before big changes (renaming, deletion, merge with another property, etc.)

Resources[edit]

Example query: Find articles on French Wikipedia with a KML file available; use English labels[edit]

The following query uses these:

  • Properties: KML file (P3096)  View with Reasonator View with SQID
    SELECT ?item ?itemLabel ?article
    WHERE
    {
    	?article schema:about ?item 
    	;	schema:isPartOf	<https://fr.wikipedia.org/> .
    	?item wdt:P3096 ?kml .
    	SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
    }
    


Then, use PetScan with this query ("Other sources" tab) to find articles which also don't already have a Template:Attached KML (Q6690822) template ("Templates&links" tab): Try it!

Check if all KML files for enwiki use this property[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, KML file (P3096)  View with Reasonator View with SQID
    #check if all KML files on enwiki are linked from an item with P3096
    SELECT ?kml ?kmlLabel ?article
    WHERE
    {
      	?kml wdt:P31 wd:Q26267864 .
    	?article schema:about ?kml 
    	;	schema:isPartOf	<https://en.wikipedia.org/> .
    	MINUS { [] wdt:P3096 ?kml } 
    	MINUS { ?kml ^wdt:P3096 [] } 
    	SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en" }
    }
    

Map of all KML files[edit]

The following query uses these:

Features: map (Q24515275)  View with Reasonator View with SQID

# Coordinates of items with KML files ;)
# by Jura1, 2016-08-27
#defaultView:Map
SELECT 
	?item ?itemLabel ?itemDescription 
	(SAMPLE (?coor) as ?coor1)
	(SAMPLE (?layerLabel) as ?layerLabel1)
	(SAMPLE (?layer) as ?layer)
	(SAMPLE (?img) as ?image)
WHERE
{
	?item wdt:P3096 [] .
	?item wdt:P625 ?coor .
	# uncomment the next line to limit to enwiki
	# [] schema:about ?item ;	schema:isPartOf	<https://en.wikipedia.org/> .
	OPTIONAL { ?item wdt:P31 ?layer } .
	OPTIONAL { ?item wdt:P18 ?img } .
	SERVICE wikibase:label {  bd:serviceParam wikibase:language "en,en" }
} 
GROUP BY ?item ?itemLabel ?itemDescription
ORDER BY DESC(?item)

Charts[edit]

Instance of[edit]

See it in Wikidata Query Service

Country[edit]

See it in Wikidata Query Service

Consistency of value labels with value label regex[edit]

This list is periodically updated by a bot. Manual changes to the list will be removed on the next update!

WDQS | PetScan | TABernacle | Find images | Recent changes
lang ?lang regex labels ≠regex % regex
English en Template:Attached KML/.+ 9617 10 99.9
Swedish sv Wikipedia:KML/.+ 461 1 99.8
Czech cs Šablona:Mapa souřadnic/.+ 1057 1 99.9

Discussion[edit]

Help:P3096[edit]

@Jura1, Rschen7754:, or any other translation administrator: could you fix/set-up/mark the translation wiki-magic for Help:P3096 (transcluded above)? Thanks, Evad37 [talk] 01:49, 25 August 2016 (UTC)[reply]

✓ Done --Rschen7754 01:53, 25 August 2016 (UTC)[reply]
Maybe the ressources section could go there too (including the chart section, once it exists).
--- Jura 13:14, 27 August 2016 (UTC)[reply]
Perhaps, but then they would be above the constraints, and I thought the constraints were more important - Evad37 [talk] 15:42, 27 August 2016 (UTC)[reply]
Sure, np. The Help page thingy is still kind of new and seems to struggle with formatting issues. I'm not sure what to think of it.
--- Jura 16:47, 27 August 2016 (UTC)[reply]

Progress by wiki[edit]

This is a list of wikis with KML files as of the creation of this property. The KML files need items to be created (or to be linked to an existing item) with instance of (P31)Wikimedia KML file (Q26267864); and the related articles' items need KML file (P3096) added.

YesY indicates all, or almost all, has been completed, as of the date that follows.

wiki (Q171) Wikidata item
(Wikimedia KML file (Q26267864))
Wikidata claim
(KML file (P3096))
enwiki English Wikipedia (Q328) YesY 2016-08-24 YesY 2016-08-24
bnwiki Bangla Wikipedia (Q427715) YesY 2016-08-26 YesY 2016-08-26
cswiki Czech Wikipedia (Q191168) YesY 2016-08-27 YesY 2016-08-27
fawiki Persian Wikipedia (Q48952) YesY (none) 2016-08-27 YesY (already done) 2016-08-27
frwiki French Wikipedia (Q8447) YesY 2016-08-24 (10) YesY 2016-08-24
jawiki Japanese Wikipedia (Q177837) YesY (none) 2016-08-28 YesY (already done) 2016-08-28
mlwiki Malayalam Wikipedia (Q874555) YesY 2016-08-28 YesY (already done) 2016-08-28
svwiki Swedish Wikipedia (Q169514) YesY 2016-08-29 YesY 2016-08-29
zhwiki Chinese Wikipedia (Q30239) YesY 2016-08-28 YesY 2016-08-28

Why no shapes?[edit]

Wohoo! Thanks for the initiative with storing this property and the work-arounds for KML files. One question - why is it limited to linear features? Why not shapes? I obviously don't have enough background, I feel like this is an obvious limitation of one of the technologies, but I don't know enough. So, this is not a criticism but just a question. --Denny (talk) 20:20, 29 August 2016 (UTC)[reply]

I don't see why it wouldn't handle polygons, see [1]. --Rschen7754 00:34, 30 August 2016 (UTC)[reply]
It can handle polygons, for example Template:Attached KML/Central Park (Q25033552) (the wording in the documentation was based on enwiki's Template:Attached KML (Q6690822) where the vast majority of uses are for linear features, most of which are roads – see #Charts above) - Evad37 [talk] 02:06, 30 August 2016 (UTC)[reply]
Thanks! That is rather awesome! Let's have shapes for all countries, and counties, and islands, and... --Denny (talk) 22:40, 31 August 2016 (UTC)[reply]

295 new KML:s for municipalities in Finland on svwiki[edit]

Those 295 articles in Svwiki have now KML-files and KML-templates. Is there a good way to ad them to WD, or can I request bot help for it in some way. Taxelson (talk) 19:57, 31 May 2017 (UTC)[reply]

Fault traces as KML file[edit]

I am active in WikiProject_Geology and am considering if and how this property could be used on items with instance of (P31) = fault (Q47089). I've made a go at it with Maynard Lake Fault (Q97732371). I welcome feedback. Trilotat (talk) 01:04, 30 July 2020 (UTC)[reply]