DBpedia SPARQL Explorer: http://dbpedia.org/snorql/
DBpedia Virtuoso SPARQL Query Editor: https://dbpedia.org/sparql
=====
People and death-causes
PREFIX dbo: <http://dbpedia.org/ontology/>
DBpedia SPARQL Explorer: http://dbpedia.org/snorql/
DBpedia Virtuoso SPARQL Query Editor: https://dbpedia.org/sparql
=====
People and death-causes
PREFIX dbo: <http://dbpedia.org/ontology/>
Follow the tutorial to install Tensorflow implementation of Syntaxet
Download the trained Portuguese model from universal dependencies and unzipped it.
Run the following command on the shell
MODEL_DIRECTORY=/Users/dbatista/Downloads/Portuguese
cd /Users/dbatista/models/syntaxnet
echo "Quase 900 funcionários do Departamento de Estado assinaram memorando que critica Trump" | syntaxnet/models/parsey_universal/parse.sh $MODEL_DIRECTORY
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn import svm, datasets | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import confusion_matrix | |
from sklearn.utils.multiclass import unique_labels | |
def plot_confusion_matrix(y_true, y_pred, classes, normalize=False, title=None, cmap=plt.cm.Blues): | |
""" |
SELECT ?iata_code ?places_served_label(LANG(?places_served_label) AS ?places_served_label_lang) ?country_code | |
WHERE { | |
?item wdt:P238 ?iata_code. | |
?item wdt:P931 ?places_served. | |
?places_served rdfs:label ?places_served_label. | |
?places_served wdt:P17 ?country. | |
?country wdt:P297 ?country_code. | |
FILTER( LANG(?places_served_label) = "de" || LANG(?places_served_label) = "en"). | |
} |
SELECT DISTINCT ?station_label ?ibnr_stmt ?x ?ibnr_type_stmnt ?label WHERE | |
{ | |
wd:Q376589 rdfs:label ?station_label. | |
wd:Q376589 p:P954 ?ibnr_stmt. | |
?ibnr_stmt ps:P954 ?x. | |
?ibnr_stmt pq:P518 ?ibnr_type_stmnt. | |
?ibnr_type_stmnt rdfs:label ?label. | |
FILTER(lang(?station_label) = 'de') | |
FILTER(lang(?label) = 'de') | |
} |
SELECT DISTINCT ?capital ?capital_label ?pop ?code WHERE { | |
?county wdt:P31/wdt:P279* wd:Q47168 . | |
?county wdt:P36 ?capital . | |
?capital rdfs:label ?capital_label . | |
?capital wdt:P1082 ?pop . | |
?county wdt:P131 ?state . | |
?state wdt:P31 wd:Q35657 . | |
?state wdt:P300 ?code . | |
FILTER(LANG(?capital_label) = "en") | |
FILTER(?pop >= 50000). |
SELECT ?iata_code ?airport_name (COUNT(?connectsairport) AS ?nr_connections) | |
WHERE | |
{ | |
VALUES ?airport { wd:Q17480 wd:Q9694 wd:Q160556 wd:Q403671} | |
?airport wdt:P238 ?iata_code. | |
?airport rdfs:label ?airport_name. | |
OPTIONAL { | |
?airport wdt:P81 ?connectsairport. | |
} | |
FILTER(LANG(?airport_name) = "en") |
#defaultView:Map | |
SELECT DISTINCT ?dam ?coords ?lat ?long WHERE { | |
?dam wdt:P31/wdt:P279* wd:Q12323 . | |
?dam wdt:P17 wd:Q45 . | |
?dam p:P625 ?coordinataes . | |
?coordinataes ps:P625 ?coords; | |
psv:P625 [ | |
wikibase:geoLatitude ?lat; | |
wikibase:geoLongitude ?long | |
] . |
#defaultView:Map | |
SELECT DISTINCT ?dam ?name ?elevation ?coords WHERE { | |
# ?dam wdt:P31/wdt:P279* wd:Q12323 . | |
?dam wdt:P31/wdt:P279* wd:Q15911738 . # only hidroelectric cpower | |
?dam wdt:P17 wd:Q45 . # only located in Portugal | |
?dam rdfs:label ?name FILTER(LANG(?name) = "pt") . | |
?dam p:P2044 ?elevation_sea_level . | |
?elevation_sea_level ps:P2044 ?elevation . | |
?dam p:P625 ?coordinataes . | |
?coordinataes ps:P625 ?coords; |
#defaultView:Map | |
SELECT DISTINCT ?companyLabel ?company ?headquarters ?headquartersLabel ?coordinates WHERE { | |
VALUES ?stock_markets {wd:Q155718 wd:Q378967 wd:Q595622 wd:Q874430} . | |
?company wdt:P361 ?stock_markets . | |
?company rdfs:label ?companyLabel . FILTER(LANG(?companyLabel) = "en") | |
?company wdt:P159 ?headquarters. | |
?headquarters rdfs:label ?headquartersLabel . FILTER(LANG(?headquartersLabel) = "en") | |
?headquarters wdt:P625 ?coordinates | |
} | |
ORDER BY ASC(?companyLabel) |