About Person entities/mentions
SELECT COUNT (distinct ?pm )
WHERE { ?pm a grz-owl:PersonMention .}
SELECT COUNT (distinct ?pe )
WHERE { ?pe a grz-owl:Person .}
Get number of mentions per entities
SELECT ?pe COUNT (distinct ?pm )
WHERE
{
?pm grz-owl:has_entityLink ?link .
?pe a grz-owl:Person .
?link grz-owl:refers_to ?pe .
}
GROUP BY ?pe
Distribution of person entities per mention count (ok)
SELECT COUNT (distinct ?pe ) AS ?NbPersonENtities ?mentionCount
WHERE
{
SELECT ?pe COUNT (distinct ?pm ) AS ?mentionCount
WHERE
{
?pm grz-owl:has_entityLink ?link .
?pe a grz-owl:Person .
?link grz-owl:refers_to ?pe .
}
GROUP BY ?pe
}
GROUP BY ?mentionCount
Role distribution of person being mentioned more than x time
SELECT ?roleType COUNT (distinct ?pe )
WHERE
{
{
?pe grz-owl:role/grz-owl:value ?roleType .
}
{
SELECT ?pe
WHERE
{
?pm grz-owl:has_entityLink ?link .
?pe a grz-owl:Person .
?link grz-owl:refers_to ?pe .
}
GROUP BY ?pe
HAVING (count(distinct ?pm) > 10 )
}
}
Select the top-10 most “mentioned” persons
SELECT ?pe COUNT (distinct ?pm )
WHERE
{
?pm a grz-owl:PersonMention ; grz-owl:has_entityLink ?link .
?pe a grz-owl:Person .
?link grz-owl:refers_to ?pe .
}
GROUP BY ?pe
ORDER BY DESC (COUNT (distinct ?pm ))
LIMIT 10
Get max number of personMention
SELECT MAX (?mentionCount ) AS ?maxMention
WHERE
{
SELECT ?pe (COUNT (distinct ?pm ) AS ?mentionCount )
WHERE
{
?pm a grz-owl:PersonMention ; grz-owl:has_entityLink ?link .
?pe a grz-owl:Person .
?link grz-owl:refers_to ?pe .
}
GROUP BY ?pe
}
Get the person with the max number of mentions
Here come an awful query which could be done better I guess, or in two passes:
SELECT ?pe ?maxMention
WHERE
{
{
?pe a grz-owl:Person .
?pm a grz-owl:PersonMention ; grz-owl:has_entityLink ?link .
?link grz-owl:refers_to ?pe .
}
{
SELECT MAX (?mentionCount ) AS ?maxMention
WHERE
{
SELECT ?pe (COUNT (distinct ?pm ) AS ?mentionCount )
WHERE
{
?pm a grz-owl:PersonMention ; grz-owl:has_entityLink ?link .
?pe a grz-owl:Person .
?link grz-owl:refers_to ?pe .
}
GROUP BY ?pe
}
}
}
GROUP BY ?pe ?maxMention
HAVING (count(distinct ?pm ) = ?maxMention )
Select Person Entities with number of mention > x
SELECT ?pe (COUNT (distinct ?pm ) AS ?countMention)
WHERE
{
?pm a grz-owl:PersonMention ; grz-owl:has_entityLink ?link .
?pe a grz-owl:Person .
?link grz-owl:refers_to ?pe .
}
GROUP BY ?pe
HAVING (count(distinct ?pm ) > 5)
ORDER BY DESC (count(distinct ?pm ))
How many Person have more than 1 mention
SELECT (COUNT (distinct ?pe ))
WHERE
{
SELECT ?pe
WHERE
{
?pe a grz-owl:Person ; grz-owl:has_mention ?link .
?link grz-owl:is_entityLink_of ?pm .
}
GROUP BY ?pe
HAVING (COUNT (distinct ?pm ) > 1 )
}
Average number of PersonMentions per Person Entities
SELECT AVG (?mentionCount )
WHERE
{
SELECT ?pe (COUNT (distinct ?pm ) AS ?mentionCount )
WHERE
{
?pm a grz-owl:PersonMention ; grz-owl:has_entityLink ?link .
?pe a grz-owl:Person .
?link grz-owl:refers_to ?pe .
}
GROUP BY ?pe
}