Anonymous

Property talk:P2: Difference between revisions

From geokb
no edit summary
No edit summary
No edit summary
Line 24: Line 24:
     ?item wdt:P84 ?same_as . # Get any same as declarations for the classification entities
     ?item wdt:P84 ?same_as . # Get any same as declarations for the classification entities
   }
   }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
</sparql>
= Vector Similarity =
In the GeoKB, the concepts built with subclass of claims extending to "[[Item:Q2|origin]]" are the collection of major descriptors about things that we link to as subject matters associated with other actors in the graph. In some of the processing work we are doing to better align disconnected data, information, and knowledge systems as linked open data, we are running experiments on vector similarity analyses to turn "label-only objects" into identified objects in the graph. We are doing this using different open-source embedding models, placing both our linkable concepts (subclasses within the graph) and "mystery objects" into a vector store where we can run different kinds of similarity analyses (nearest neighbor, cosine similarity, Euclidian distance, etc.) to determine where we have a reasonable enough relationship to create a link with qualifiers indicating embedding model used and any other details.
The following query can be used to pull together relevant items for embedding as potential target objects in vector space.
<sparql tryit="1">
PREFIX geokbe: <https://geokb.wikibase.cloud/entity/>
PREFIX geokbp: <https://geokb.wikibase.cloud/prop/direct/>
SELECT ?item ?itemLabel ?itemDescription ?classLabel
(CONCAT(?itemLabel, " - ", ?itemDescription, " (", COALESCE(?itemAltLabel, ""), ")") AS ?embedding_text)
WHERE {
  ?item geokbp:P2* ?class .
  VALUES ?class { geokbe:Q3 geokbe:Q158710 geokbe:Q159046 }
  FILTER(?item != geokbe:Q3)
  FILTER(?item != geokbe:Q158710)
  FILTER(?item != geokbe:Q159046)
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
}
</sparql>
</sparql>