This file contains 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
### TURTLE START ### | |
PREFIX : <https://help.twitter.com/en/using-twitter/cotweets#> | |
PREFIX schema: <http://schema.org/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
:cotweet | |
a schema:Question; | |
rdfs:label """What’s a CoTweet?"""^^xsd:string; | |
schema:acceptedAnswer :cotweet-answer. |
This file contains 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
## Turtle Start ## | |
@prefix: <#>. | |
:A :route ([:to :B; :distance 50] ); | |
:route ([:to :C; :distance 50]); | |
:route ([:to :D; :distance 20]). | |
:C a :Place; | |
:route ([:to :E; :distance 20] ). |
This file contains 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 * | |
WHERE | |
{ | |
?s dbp:birthDate ?birth. | |
FILTER(DATATYPE(?birth) = xsd:date) | |
} | |
LIMIT 10 |
This file contains 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
input { | |
jdbc { | |
jdbc_driver_library => "/path_to_virtuoso_jdbc_driver/virtjdbc4.jar" | |
jdbc_driver_class => "Java::virtuoso.jdbc4.Driver" | |
jdbc_connection_string => "jdbc:virtuoso://localhost:1111" | |
jdbc_user => "{Username}" | |
jdbc_password => "{Password}" | |
#SPARQL-Within-SQL Example | |
statement => "SELECT CAST(X.s as varchar) AS test FROM (SPARQL SELECT ?s WHERE {?s ?p ?o} LIMIT 10) as X" |
This file contains 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
[Local Virtuoso Demo PyODBC] | |
Driver = /opt/virtuoso/lib/virtodbcu_r.so | |
Address = localhost:21118 | |
PWDClearText = 0 | |
LastUser = dba | |
DayLight = Yes | |
RoundRobin = No | |
NoSystemTables = No | |
TreatViewsAsTables = No | |
WideAsUTF16 = Yes |
This file contains 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
SPARQL | |
SELECT * | |
WHERE | |
{ | |
SERVICE <https://yyour-neptune-instance.ct2pgivua9wd.us-east-1.neptune.amazonaws.com:8182/sparql> | |
{ | |
?s ?p ?o | |
} | |
} | |
LIMIT 1 |
This file contains 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
import pyodbc as db | |
q = "SELECT * FROM demo..company" | |
cnxn = db.connect("DSN=Demo DB;UID=vdb;PWD=vdb") | |
cursor=cnxn.cursor() | |
cursor.execute(q) | |
row=cursor.fetchall() | |
if row: | |
print(row) |
This file contains 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 * FROM demo.dbpedia.company |
This file contains 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
CREATE VIEW demo.dbpedia.company | |
AS | |
( | |
SPARQL | |
PREFIX dbr: <http://dbpedia.org/resource/> | |
PREFIX dbp: <http://dbpedia.org/property/> | |
PREFIX dbo: <http://dbpedia.org/ontology/> | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT * |
This file contains 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 * | |
WHERE | |
{ | |
?company dbp:type <http://dbpedia.org/resource/Public_company>; | |
rdfs:label ?companyName; | |
dbo:industry dbr:Automobile; | |
dbo:product/rdfs:label ?product. | |
FILTER(lang(?companyName)= 'en' && lang(?product) = 'en'). | |
} |
NewerOlder