Skip to content

Instantly share code, notes, and snippets.

@datamusee
datamusee / gist:2c40d8370f9371b74716c09528caa91e
Created February 22, 2024 15:39
Sparql query on Wikidata; get fonctionnality and inverse functionnalité of properties of painting in the Joconde dataset without filtering about functionnality
# cherche si des propriétés de peinture sont fonctionnelles inverse ou quasi
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?p ?propLabel ?entityCount ?sumValueCount ?valueCount ?sumEntityCount ?f ?if
{
{
select ?p ?propLabel ?valueCount ?sumEntityCount ?if
@datamusee
datamusee / gist:c0eabe5748919ae14d9c32094ed3962f
Created February 22, 2024 15:30
Sparql query on Wikidta; get fonctionnality and inverse functionnalité a of properties of painting in the Joconde dataset
# cherche si des propriétés de peinture sont fonctionnelles inverse ou quasi
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?p ?propLabel ?entityCount ?sumValueCount ?valueCount ?sumEntityCount ?f ?if
{
{
select ?p ?propLabel ?valueCount ?sumEntityCount ?if
@datamusee
datamusee / gist:c3a21db9787530e13af81614f820f8b9
Created February 22, 2024 15:24
Sparql query on Wikidta; get inverse fonctionnality a of properties of painting in the Joconde dataset
# cherche si des propriétés de peinture sont fonctionnelles inverse ou quasi
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?p ?propLabel ?valueCount ?sumEntityCount ?if
where
{
#values ?p {wdt:P347}
@datamusee
datamusee / gist:a26ad672d92c5ca0353dc032169f5769
Created February 22, 2024 15:15
Sparql query on Wikidta; get fonctionnality a of properties of painting in the Joconde dataset
# cherche si des propriétés de peinture sont fonctionnelles ou quasi
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?p ?propLabel ?entityCount ?sumValueCount ?f
where
{
#values ?p {wdt:P347}
@datamusee
datamusee / gist:5da33122caa161eff62dd93a4d6cadff
Last active February 22, 2024 11:59
Sparql query on Wikidata KG; get the main types of entities with a Jocone ID, get the number of instances, the total and average number of properties
# compte le nombre d'instance d'entités pour chaque type ayant 50 ou plus instances
# pour les entités de chaque type, compte le nombre de triplets
# en déduit le nombre moyen de propriétés pour chacun des types retenus
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?type ?typeCount ?propertyCount ?averagePropCount
where
{
@datamusee
datamusee / gist:25e111c2415dde05fea631810780817a
Created February 22, 2024 11:22
Sparql query on WJoconde KG; get the main types of entity with total and average number of properties
# compte le nombre d'instance d'entités pour chaque type ayant 50 ou plus instances
# pour les entités de chaque type, compte le nombre de triplets
# en déduit le nombre moyen de propriétés pour chacun des types retenus
PREFIX xs: <http://www.w3.org/2001/XMLSchema#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?type ?typeCount ?propertyCount ?averagePropCount
where
{
@datamusee
datamusee / describeConceptWorkSemJoconde.rq
Last active April 16, 2023 05:51
Example to generate a description (DESCRIBE) from an URI for the concept linkedto a SemJoconde work
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema>
PREFIX dm: <http://datamusee.givingsense.eu/onto/>
prefix dmc: <http://datamusee.givingsense.eu/onto/work/concept/>
prefix dmo: <http://datamusee.givingsense.eu/onto/>
prefix cidoc: <http://erlangen-crm.org/current/>
prefix gjoc: <http://joconde.givingsense.eu/graph/>
construct {
?concept cidoc:P65_is_shown_by ?physical .
?concept a ?ctype .
?oeuvre cidoc:P94_has_created ?concept .
@datamusee
datamusee / describeEventWorkSemJoconde.rq
Last active April 15, 2023 14:32
Example to generate a description (DESCRIBE) from an URI for the act of creation of a SemJoconde work
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dm: <http://datamusee.givingsense.eu/onto/>
prefix crm: <http://erlangen-crm.org/current/>
construct
{
?acte crm:P108_has_produced ?physical ; ?pa ?oa .
?pa rdfs:label ?labelpa .
?oa rdfs:label ?labeloa .
?physical dm:DMP18_has_current_curator ?site ; ?pp ?op .
?pp rdfs:label ?labelpp .
{
sites(first:3){
siteslist: edges {
site: node {
prefLabel
}
}
}
}