This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@prefix sport: <http://www.bbc.co.uk/ontologies/sport/> . | |
@prefix stat: <http://example-ontology/statistics/> . | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | |
<event1> a sport:SportsCompetition ; | |
sport:awayCompetitor <team1> ; | |
sport:homeCompetitor <team2> ; | |
stat:hasTeamStatistics <teamStats1> , <teamStats2> . | |
<team1> a sport:CompetitiveSportingOrganisation ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
s.service_id, COUNT(s.service_id) | |
FROM | |
service s | |
LEFT JOIN | |
(SELECT | |
s.service_id | |
FROM | |
service s | |
JOIN broadcast b ON s.service_id = b.service_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
pp.parent_pid, | |
COUNT(pp.child_pid) AS 'episode_count', | |
versions.version_count, | |
broadcasts.broadcast_count | |
FROM | |
pip_pip pp | |
JOIN | |
(SELECT | |
pp.parent_pid AS 'brand_pid', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
id.value, COUNT(id.entity_pid) | |
FROM | |
identifier id | |
WHERE | |
id.type = 'uid' | |
GROUP BY id.value | |
HAVING COUNT(id.entity_pid) > 1 | |
ORDER BY id.created DESC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT | |
pg.pid, | |
GROUP_CONCAT(g.topleveltext, | |
' | ', | |
g.secondleveltext, | |
g.thirdleveltext | |
SEPARATOR ' | ') AS 'genres' | |
FROM | |
pip_genre pg | |
JOIN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from requests import get, put | |
import os | |
import argparse | |
import xml.etree.ElementTree as ET | |
parser = argparse.ArgumentParser(description='Entities and their pids.') | |
parser.add_argument('child_pid', type=str, help='The pid of the child entity') | |
parser.add_argument('parent_pid', type=str, help='The pid of the parent entity') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
YEAR(cl.created), | |
CASE | |
WHEN MONTH(v.created) = '1' THEN 'Jan' | |
WHEN MONTH(v.created) = '2' THEN 'Feb' | |
WHEN MONTH(v.created) = '3' THEN 'Mar' | |
WHEN MONTH(v.created) = '4' THEN 'Apr' | |
WHEN MONTH(v.created) = '5' THEN 'May' | |
WHEN MONTH(v.created) = '6' THEN 'Jun' | |
WHEN MONTH(v.created) = '7' THEN 'Jul' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
YEAR(v.created) AS 'year', | |
CASE | |
WHEN MONTH(v.created) = '1' THEN 'Jan' | |
WHEN MONTH(v.created) = '2' THEN 'Feb' | |
WHEN MONTH(v.created) = '3' THEN 'Mar' | |
WHEN MONTH(v.created) = '4' THEN 'Apr' | |
WHEN MONTH(v.created) = '5' THEN 'May' | |
WHEN MONTH(v.created) = '6' THEN 'Jun' | |
WHEN MONTH(v.created) = '7' THEN 'Jul' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
fbs.service_id, | |
fbs.year, | |
CASE | |
WHEN MONTH(fbs.published_date) = '1' THEN 'Jan' | |
WHEN MONTH(fbs.published_date) = '2' THEN 'Feb' | |
WHEN MONTH(fbs.published_date) = '3' THEN 'Mar' | |
WHEN MONTH(fbs.published_date) = '4' THEN 'Apr' | |
WHEN MONTH(fbs.published_date) = '5' THEN 'May' | |
WHEN MONTH(fbs.published_date) = '6' THEN 'Jun' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
fbs.service_id, | |
fbs.year, | |
CASE | |
WHEN MONTH(fbs.published_date) = '1' THEN 'Jan' | |
WHEN MONTH(fbs.published_date) = '2' THEN 'Feb' | |
WHEN MONTH(fbs.published_date) = '3' THEN 'Mar' | |
WHEN MONTH(fbs.published_date) = '4' THEN 'Apr' | |
WHEN MONTH(fbs.published_date) = '5' THEN 'May' | |
WHEN MONTH(fbs.published_date) = '6' THEN 'Jun' |
NewerOlder