BDI Data:Importing ABCD Data Structures into other Wikibase instances

From BDI Data
Jump to: navigation, search

Goal

This page describes a way to transfer the concepts of the ABCD Ontology as modeled in this wiki to a different wikibase instance where they can be used to actually describe data. This requires a shift in the nature of these concepts. For instance in this wiki ABCD Properties (either datatype properties or object properties) are described as Wikibase Items but in the other wikibase instance they need to be Wikibase Properties, as they will be used to describe actual data.

Prequisites

  • Have a Wikibase instance set up and running
  • Have a Query Service (WBQ) set up and running
  • Have QuickStatements (QS) set up and running

The easiest way to have all of the services setup and working together is to use the Wikibase Docker image.

However some minor modifications are required in order for QuickStatements to work:

have not been fixed, the changes described in those tickets must be done manually, so that QS is able to create and modify properties.


  • Install the Wikidata-Proxy and adjust code to include your own SPARQL Endpoint.
  • Not required but advised: Install the Templates and Modules necessary for the SPARQL-Templates used in this page to document interesting and necessary SPARQL queries.
    • Requires Extension:Scribunto to be installed and enabled and the already installed extensions "ParserFunctions" and "SyntaxHighlight_GeSHi" to be enabled.
    • The URLs for the Query page need to be adjusted in the template files for your custom wikibase installation.


Manual Creation of Vital Properties

  • Create property for BDI-Data ID (type External-ID).
Quickstatements
    • for the following examples this will by "P7"
  • Create property for Formatter URL (type String)
    • Adjust Formatter URL in Wikibase settings to this type
    • Add Formatter URL Property to BDI-Data ID with value "https://wiki.bgbm.org/entity/$1"


Import Meta Concepts

The following query uses these:
  • Properties: is part of (P8) 
     1 #all Concepts that are linked to from an ABCD concept but are not themselves ABCD and dedicated Terminology Meta Concepts
     2 PREFIX bwd: <http://wiki.bgbm.org/entity/>
     3 PREFIX bwdt: <http://wiki.bgbm.org/prop/direct/>
     4 
     5 SELECT DISTINCT ?item2 ?item2Label ?item2Description ?item2AltLabel (count(?item) as ?count) WHERE{
     6   {
     7     ?item bwdt:P8 bwd:Q219 ;
     8         ?prop ?statement.
     9     ?property wikibase:directClaim ?prop.
    10     ?property wikibase:propertyType wikibase:WikibaseItem.
    11     ?item ?prop ?item2.
    12     FILTER NOT EXISTS{ ?item2 bwdt:P8 bwd:Q219 }
    13   }UNION{
    14     #everything that is part of Terminology Meta Concepts
    15     ?item2 bwdt:P8 bwd:Q30.
    16   }
    17   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .}
    18 }
    19 GROUP BY ?item2 ?item2Label ?item2Description ?item2AltLabel 
    20 ORDER BY DESC(?count)
    

Processing Steps

  • Load data into OpenRefine, using the Proxy Link
  • Select UTF-8 as the Character Encoding
  • Go on "Export" -> "Templating"
    • clear all of the prefilled template fields and enter the code below in the "Row Template". Be sure to include the last line break at the end (having additional line breaks doesn't matter for QuickStatements, so just add one more, just to be sure).
CREATE 
LAST	Len	{{jsonize(cells["item2Label"].value)}}
{{if(isNonBlank(cells["item2Description"].value),"LAST	Den	"+jsonize(cells["item2Description"].value)+"
","")}}{{if(isBlank(cells["item2AltLabel"].value),"",forEach(split(cells["item2AltLabel"].value,", "),alias,"LAST	Aen	"+jsonize(alias)+"
"))}}LAST	P7	"{{substring(cells["item2"].value,length("http://wiki.bgbm.org/entity/"))}}"
 
  • Click on Export and save file.
  • Run content of file in QuickStatements.

Import Meta Properties, Statement Properties and Statement Qualifiers

The following query uses these:
  • Properties: is part of (P8) , is of type (P9) 
     1 # all properties that are either used as properties or qualifiers by ABCD concepts or as properties for its Meta Concepts, combined
     2 PREFIX bwd: <http://wiki.bgbm.org/entity/>
     3 PREFIX bwdt: <http://wiki.bgbm.org/prop/direct/>
     4 
     5 SELECT DISTINCT ?property ?propertyLabel ?propertyDescription ?propertyAltLabel ?type  WHERE{
     6   {
     7     SELECT DISTINCT ?property ?internalType ?overwriteType WHERE{
     8       #all properties used within ABCD
     9       ?concept bwdt:P8 bwd:Q219 ;
    10             ?prop ?value.
    11       ?property wikibase:directClaim ?prop.
    12       ?property wikibase:propertyType ?internalType.
    13       
    14       OPTIONAL{
    15         VALUES ?propertyTypes {bwd:Q10 bwd:Q33 bwd:Q34}
    16         ?value bwdt:P9 ?propertyTypes.
    17         #for each element where the targes are of one of the desired types, create a marker to overwrite the type from the initial retrieval (wikibase:WikibaseProperty instead of wikibase:WikibaseItem)
    18         BIND (wikibase:WikibaseProperty as ?overwriteType).
    19       }
    20     }
    21   }UNION{
    22     SELECT DISTINCT ?property ?internalType ?overwriteType WHERE {
    23       #all qualifiers used within ABCD
    24       ?concept bwdt:P8 bwd:Q219.
    25     
    26       ?concept ?property_p ?statement.
    27       ?statement ?property_ps ?item.
    28       FILTER REGEX (STR(?property_ps), "http://wiki.bgbm.org/prop/statement/P").
    29       ?property_ ?ref ?property_p .
    30     
    31       ?statement ?qualifier_q ?value.
    32       FILTER REGEX (STR(?qualifier_q), "http://wiki.bgbm.org/prop/qualifier/P").
    33       ?property_ rdf:type wikibase:Property .
    34       ?property wikibase:qualifier ?qualifier_q .
    35     
    36       ?property wikibase:propertyType ?internalType.
    37       
    38       OPTIONAL{
    39         VALUES ?propertyTypes {bwd:Q10 bwd:Q33 bwd:Q34}
    40         ?value bwdt:P9 ?propertyTypes.
    41         #for each element where the targes are of one of the desired types, create a marker to overwrite the type from the initial retrieval (wikibase:WikibaseProperty instead of wikibase:WikibaseItem)
    42         BIND (wikibase:WikibaseProperty as ?overwriteType).
    43       }
    44     }
    45   }UNION{
    46     SELECT DISTINCT ?property ?internalType ?overwriteType WHERE{
    47       #the values of the meta concepts are hardcoded from the result of the previous query, as I couldn't get the subquery for it to work. This has to be manually rechecked if it is still complete, once the code is run.
    48       VALUES ?metaConcept {bwd:Q34 bwd:Q14 bwd:Q16 bwd:Q32 bwd:Q33 bwd:Q81 bwd:Q219 bwd:Q357 bwd:Q10 bwd:Q2042}
    49       ?metaConcept ?prop ?object.
    50       ?property wikibase:directClaim ?prop.
    51       ?property wikibase:propertyType ?internalType.
    52      
    53       OPTIONAL{
    54         VALUES ?propertyTypes {bwd:Q10 bwd:Q33 bwd:Q34}
    55         ?object bwdt:P9 ?propertyTypes.
    56         #for each element where the targes are of one of the desired types, create a marker to overwrite the type from the initial retrieval (wikibase:WikibaseProperty instead of wikibase:WikibaseItem)
    57         BIND (wikibase:WikibaseProperty as ?overwriteType).
    58       }
    59     }
    60   }
    61   
    62   BIND(IF(bound(?overwriteType), ?overwriteType, ?internalType) as ?type )
    63   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    64 }
    

Processing Steps

  • Select UTF-8 as the Character Encoding
  • On column type, go on "Edit cells" -> "Transform" and apply this transformation:
value.replace("http://wikiba.se/ontology#CommonsMedia","commonsMedia").replace("http://wikiba.se/ontology#ExternalId","external-id").replace("http://wikiba.se/ontology#Globecoordinate","globe-coordinate").replace("http://wikiba.se/ontology#GeoShape","geo-shape").replace("http://wikiba.se/ontology#WikibaseItem","wikibase-item").replace("http://wikiba.se/ontology#Math","math").replace("http://wikiba.se/ontology#Monolingualtext","monolingualtext").replace("http://wikiba.se/ontology#Time","time").replace("http://wikiba.se/ontology#WikibaseProperty","wikibase-property").replace("http://wikiba.se/ontology#Quantity","quantity").replace("http://wikiba.se/ontology#String","string").replace("http://wikiba.se/ontology#TabularData","tabular-data").replace("http://wikiba.se/ontology#Url","url").replace("http://wikiba.se/ontology#Lexeme","wikibase-lexeme").replace("http://wikiba.se/ontology#Form","wikibase-form")
  • Go on "Export" -> "Templating"
    • clear all of the prefilled template fields and enter the code below in the "Row Template". Be sure to include the last line break at the end.
CREATEP	{{cells["type"].value}}
LAST	Len	{{jsonize(cells["propertyLabel"].value)}}
{{if(isNonBlank(cells["propertyDescription"].value),"LAST	Den	"+jsonize(cells["propertyDescription"].value)+"
","")}}{{if(isBlank(cells["propertyAltLabel"].value),"",forEach(split(cells["propertyAltLabel"].value,", "),alias,"LAST	Aen	"+jsonize(alias)+"
"))}}LAST	P7	"{{substring(cells["property"].value,length("http://wiki.bgbm.org/entity/"))}}"

  • Click on Export and save file.
  • Run content of file in QuickStatements.

Import Statements on Meta Concepts

The following query uses these:
  • Properties: is part of (P8) 
     1 #all properties that are used to describe Meta Concepts (concepts that are linked from ABCD but are not part of ABCD)
     2 PREFIX bwd: <http://wiki.bgbm.org/entity/>
     3 PREFIX bwdt: <http://wiki.bgbm.org/prop/direct/>
     4 
     5 SELECT DISTINCT ?item2 ?metaProperty ?value WHERE{
     6   {
     7     ?item bwdt:P8 bwd:Q219 ;
     8         ?prop ?statement.
     9     ?property wikibase:directClaim ?prop.
    10     ?property wikibase:propertyType wikibase:WikibaseItem.
    11     ?item ?prop ?item2.
    12     FILTER NOT EXISTS{ ?item2 bwdt:P8 bwd:Q219 }
    13   }UNION{
    14     #everything that is part of Terminology Meta Concepts
    15     ?item2 bwdt:P8 bwd:Q30.
    16   }
    17   ?item2 ?metaProperty ?value.
    18   FILTER REGEX (STR(?metaProperty), "http://wiki.bgbm.org/prop/direct/P").
    19 }
    

Processing Steps

  • Load data into OpenRefine, using the Proxy Link
  • Select UTF-8 as the Character Encoding
  • add a column for each existing column by fetching URL. The column names should be the old ones with an "_query" at the end.
"https://wiki.bgbm.org/tools/wikibase/wikidata-proxy/?server=test&query=SELECT%20*%20WHERE%20%7B%3Fitem%20%3Chttp%3A%2F%2Fwikibase.svc%2Fprop%2Fdirect%2FP7%3E%20%22"+value.substring(value.lastIndexOf("/")+1)+"%22%7D"
    • IMPORTANT: this query contains the hard-coded property for the BDI-Data ID, as described in section Manual Creation of Vital Properties. It is the "P7" towards the end, before "%3E%20%22". This needs to be adjusted for the new wiki in question. Also the same query is used a couple of more times below. It is always the same query for the "Add column by fetching URLs".
  • check using a Text Length Facet on the newly created columns if there are any items or properties whose IDs could not be converted
  • Go on "Export" -> "Templating"
    • clear all of the prefilled template fields and enter the code below in the "Row Template". Be sure to include the last line break at the end.
{{trim(substring(cells["item2_query"].value,cells["item2_query"].value.lastIndexOf("/")+1)))}}	{{trim(substring(cells["metaProperty_query"].value,cells["metaProperty_query"].value.lastIndexOf("/")+1)))}}	{{trim(substring(cells["value_query"].value,cells["value_query"].value.lastIndexOf("/")+1)))}}

  • Click on Export and save file.
  • Run content of file in QuickStatements.

Import Statements on Properties

//TODO: handle monolingual text, as done in section Import Statements on ABCD Concepts

The following query uses these:
  • Properties: is part of (P8) , property export order (P81) 
     1 # all properties that are used to describe either properties or qualifiers by ABCD concepts or as properties for its Meta Concepts
     2 PREFIX bwd: <http://wiki.bgbm.org/entity/>
     3 PREFIX bwdt: <http://wiki.bgbm.org/prop/direct/>
     4 
     5 SELECT DISTINCT ?property ?metaProperty ?value WHERE{
     6   {
     7     SELECT DISTINCT ?property ?type WHERE{
     8       #all properties used within ABCD
     9       ?concept bwdt:P8 bwd:Q219 ;
    10             ?prop ?statement.
    11       ?property wikibase:directClaim ?prop.
    12       ?property wikibase:propertyType ?type.
    13     }
    14   }UNION{
    15     SELECT DISTINCT ?property ?type WHERE {
    16       #all qualifiers used within ABCD
    17       ?concept bwdt:P8 bwd:Q219.
    18     
    19       ?concept ?property_p ?statement.
    20       ?statement ?property_ps ?item.
    21       FILTER REGEX (STR(?property_ps), "http://wiki.bgbm.org/prop/statement/P").
    22       ?property_ ?ref ?property_p .
    23     
    24       ?statement ?qualifier_q ?value.
    25       FILTER REGEX (STR(?qualifier_q), "http://wiki.bgbm.org/prop/qualifier/P").
    26       ?property_ rdf:type wikibase:Property .
    27       ?property wikibase:qualifier ?qualifier_q .
    28     
    29       ?property wikibase:propertyType ?type.
    30     }
    31   }UNION{
    32     SELECT DISTINCT ?property ?type WHERE{
    33       #the values of the meta concepts are hardcoded from the result of the previous query, as I couldn't get the subquery for it to work. This has to be manually rechecked if it is still complete, once the code is run.
    34       VALUES ?metaConcept {bwd:Q34 bwd:Q14 bwd:Q16 bwd:Q32 bwd:Q33 bwd:Q81 bwd:Q219 bwd:Q357 bwd:Q10 bwd:Q2042}
    35       ?metaConcept ?prop ?statement.
    36       ?property wikibase:directClaim ?prop.
    37       ?property wikibase:propertyType ?type.
    38     }GROUP BY $property ?type
    39   }
    40   ?property ?metaProperty ?value.
    41   
    42   MINUS {
    43     ?property bwdt:P81 ?value.  # exclude the export order property, as this is a Meta-Meta-property only for setting the order in which the properties should be imported into another wikibase instance. 
    44               #if you want to include this information as well, the property has to be created manually (with the BDI ID property), as it is not part of the query in "Import Meta Properties, Statement Properties and Statement Qualifiers"
    45               #   then you can remove this MINUS clause.
    46   }
    47 
    48   FILTER REGEX (STR(?metaProperty), "http://wiki.bgbm.org/prop/direct/P").
    49 }
    

Processing Steps

  • add a column for each existing column by fetching URL. The column names should be the old ones with an "_query" at the end.
"https://wiki.bgbm.org/tools/wikibase/wikidata-proxy/?server=test&query=SELECT%20*%20WHERE%20%7B%3Fitem%20%3Chttp%3A%2F%2Fwikibase.svc%2Fprop%2Fdirect%2FP7%3E%20%22"+value.substring(value.lastIndexOf("/")+1)+"%22%7D"
  • check using a Text Length Facet on the newly created columns if there are any items or properties whose IDs could not be converted
  • Go on "Export" -> "Templating"
    • clear all of the prefilled template fields and enter the code below in the "Row Template". Be sure to include the last line break at the end.
{{trim(substring(cells["property_query"].value,cells["property_query"].value.lastIndexOf("/")+1)))}}	{{trim(substring(cells["metaProperty_query"].value,cells["metaProperty_query"].value.lastIndexOf("/")+1)))}}	{{if(length(cells["value_query"].value) == 6,"\""+cells["value"].value+"\"",trim(substring(cells["value_query"].value,cells["value_query"].value.lastIndexOf("/")+1)))}}
 
  • Click on Export and save file.
  • Run content of file in QuickStatements.

Import ABCD Concepts

The following query uses these:
  • Properties: is part of (P8) , is of type (P9) , has datatype (P27) 
     1 #all ABCD 3.0 concepts with their types and datatypes (for datatype properties)
     2 PREFIX bwd: <http://wiki.bgbm.org/entity/>
     3 PREFIX bwdt: <http://wiki.bgbm.org/prop/direct/>
     4 
     5 SELECT DISTINCT ?item ?itemLabel ?itemDescription ?itemAltLabel ?type ?typeLabel ?datatype WHERE{
     6     ?item bwdt:P8 bwd:Q219.
     7     ?item bwdt:P9 ?type. 
     8     OPTIONAL{
     9       ?item  bwdt:P27 ?datatype
    10     }
    11     SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    12 }
    

Processing Steps

  • Load data into OpenRefine, using the Proxy Link
  • Select UTF-8 as the Character Encoding
  • Go on "Export" -> "Templating"
    • clear all of the prefilled template fields and enter the code below in the "Row Template". Be sure to include the last line break at the end.
{{if(cells["type"].value=="http://wiki.bgbm.org/entity/Q10","CREATE_PROPERTY	string",
if(cells["type"].value=="http://wiki.bgbm.org/entity/Q33","CREATE_PROPERTY	wikibase-item",
if(cells["type"].value=="http://wiki.bgbm.org/entity/Q34",
  if(cells["datatype"].value=="http://www.w3.org/2001/XMLSchema#string","CREATE_PROPERTY	string",
  if(cells["datatype"].value=="http://www.w3.org/2001/XMLSchema#anyURI","CREATE_PROPERTY	url",
  "CREATE_PROPERTY	quantity"))
,"CREATE")))}}
LAST	Len	{{jsonize(cells["itemLabel"].value)}}
{{if(isNonBlank(cells["itemDescription"].value),"LAST	Den	"+jsonize(cells["itemDescription"].value)+"
","")}}{{if(isBlank(cells["itemAltLabel"].value),"",forEach(split(cells["itemAltLabel"].value,", "),alias,"LAST	Aen	"+jsonize(alias)+"
"))}}LAST	P7	"{{substring(cells["item"].value,length("http://wiki.bgbm.org/entity/"))}}"

  • Click on Export and save file.
  • Run content of file in QuickStatements.

Import Statements on ABCD Concepts

The following query uses these:
  • Properties: is part of (P8) , property export order (P81) 
     1 PREFIX bwd: <http://wiki.bgbm.org/entity/>
     2 PREFIX bwdt: <http://wiki.bgbm.org/prop/direct/>
     3 
     4 SELECT ?item ?itemLabel ?metaProperty ?propertyLabel ?value ?valueLabel ?type ?language WHERE{
     5     ?item bwdt:P8 bwd:Q219.
     6     ?item ?metaProperty ?value.
     7     BIND(lang(?value) as ?language).
     8     ?property wikibase:directClaim ?metaProperty.
     9     ?property wikibase:propertyType ?type.
    10     ?property bwdt:P81 ?order.
    11 
    12     FILTER REGEX (STR(?metaProperty), "http://wiki.bgbm.org/prop/direct/P").
    13     SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    14 }ORDER BY ?order
    


Processing Steps

Note: the labels are only in there for debugging and visual orientation for the person doing the transfer

  • Add columns item_query, metaProperty_query based on the corresponding columns by fetching URL:
"https://wiki.bgbm.org/tools/wikibase/wikidata-proxy/?server=test&query=SELECT%20*%20WHERE%20%7B%3Fitem%20%3Chttp%3A%2F%2Fwikibase.svc%2Fprop%2Fdirect%2FP7%3E%20%22"+value.substring(value.lastIndexOf("/")+1)+"%22%7D"
  • Check using a Text Length Facet on the two newly created columns if there are any items or properties whose IDs could not be converted
  • Apply a Text Facet to column type and select "http://wikiba.se/ontology#WikibaseItem"
  • Add column value_query based on value by fetching URL, as above.
  • Check using a Text Length Facet on value_query if there are any items or properties whose IDs could not be converted
  • Remove the text facet
  • Go on "Export" -> "Templating"
    • clear all of the prefilled template fields and enter the code below in the "Row Template". Be sure to include the last line break at the end.
{{trim(substring(cells["item_query"].value,cells["item_query"].value.lastIndexOf("/")+1)))}}	{{trim(substring(cells["metaProperty_query"].value,cells["metaProperty_query"].value.lastIndexOf("/")+1)))}}	{{
if(cells["type"].value=="http://wikiba.se/ontology#WikibaseItem",trim(substring(cells["value_query"].value,cells["value_query"].value.lastIndexOf("/")+1)),
if(cells["type"].value=="http://wikiba.se/ontology#Monolingualtext",cells["language"].value+":","")+jsonize(cells["value"].value))}}

  • Click on Export and save file.
  • Run content of file in QuickStatements.

Import Qualifiers on Statements on ABCD Concepts

The following query uses these:
  • Properties: is part of (P8) 
     1 PREFIX bwd: <http://wiki.bgbm.org/entity/>
     2 PREFIX bwdt: <http://wiki.bgbm.org/prop/direct/>
     3 
     4 SELECT ?concept ?conceptLabel ?property_d ?propertyLabel ?item ?item_type ?item_language ?qualifier ?value ?qualifierpropertyLabel ?qualifier_type ?qualifier_language WHERE {
     5   ?concept bwdt:P8 bwd:Q219.
     6   ?concept ?property_p ?statement.
     7   ?concept ?property_d ?item.
     8   ?statement ?property_ps ?item.
     9   ?statement ?qualifier ?value.
    10   
    11   BIND(lang(?value) as ?qualifier_language).
    12   BIND(lang(?item) as ?item_language).
    13   
    14   ?property wikibase:directClaim ?property_d.
    15   ?property wikibase:propertyType ?item_type.
    16   
    17   ?qualifierproperty wikibase:qualifier ?qualifier.
    18   ?qualifierproperty wikibase:propertyType ?qualifier_type.
    19   FILTER REGEX (STR(?property_ps), "http://wiki.bgbm.org/prop/statement/P").
    20   FILTER REGEX (STR(?qualifier), "http://wiki.bgbm.org/prop/qualifier/P").
    21   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
    22   
    23 }
    24 ORDER BY ?concept ?property
    

Processing Steps

  • Load data into OpenRefine, using the Proxy Link
  • Select UTF-8 as the Character Encoding
  • Add columns concept_query, property_d_query and qualifier_query based on the corresponding columns by fetching URL:
"https://wiki.bgbm.org/tools/wikibase/wikidata-proxy/?server=test&query=SELECT%20*%20WHERE%20%7B%3Fitem%20%3Chttp%3A%2F%2Fwikibase.svc%2Fprop%2Fdirect%2FP7%3E%20%22"+value.substring(value.lastIndexOf("/")+1)+"%22%7D"
  • Check using a Text Length Facet on the two newly created columns if there are any items or properties whose IDs could not be converted
  • Apply a Text Facet to column item_type and select "http://wikiba.se/ontology#WikibaseItem"
  • Add column item_query based on item by fetching URL, as above.
  • Check using a Text Length Facet on item_query if there are any items or properties whose IDs could not be converted
  • Remove the text facet
  • Apply a Text Facet to column qualifier_type and select "http://wikiba.se/ontology#WikibaseItem"
  • Add column value_query based on value by fetching URL, as above.
  • Check using a Text Length Facet on value_query if there are any items or properties whose IDs could not be converted
  • Remove the text facet
  • Go on "Export" -> "Templating"
    • clear all of the prefilled template fields and enter the code below in the "Row Template". Be sure to include the last line break at the end.
{{trim(substring(cells["concept_query"].value,cells["concept_query"].value.lastIndexOf("/")+1)))}}	{{trim(substring(cells["property_d_query"].value,cells["property_d_query"].value.lastIndexOf("/")+1)))}}	{{
if(cells["item_type"].value=="http://wikiba.se/ontology#WikibaseItem",trim(substring(cells["item_query"].value,cells["item_query"].value.lastIndexOf("/")+1)),
if(cells["item_type"].value=="http://wikiba.se/ontology#Monolingualtext",cells["item_language"].value+":","")+jsonize(cells["item"].value))}}	{{trim(substring(cells["qualifier_query"].value,cells["qualifier_query"].value.lastIndexOf("/")+1)))}}	{{
if(cells["qualifier_type"].value=="http://wikiba.se/ontology#WikibaseItem",trim(substring(cells["value_query"].value,cells["value_query"].value.lastIndexOf("/")+1)),
if(cells["qualifier_type"].value=="http://wikiba.se/ontology#Quantity",trim(cells["value"].value),
if(cells["qualifier_type"].value=="http://wikiba.se/ontology#Monolingualtext",cells["qualifier_language"].value+":","")+jsonize(cells["value"].value)))}}
 
  • Click on Export and save file.
  • Run content of file in QuickStatements.