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
#!/bin/bash | |
if [ "$#" -ne 1 ]; then | |
echo "missing directory" | |
echo "Usage: ./flat_directory.sh DIR" | |
exit -1 | |
fi | |
DIR=$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
LDClientService ldclient = new LDClient(); | |
ClientResponse response = ldclient.retrieveResource("http://sws.geonames.org/2658434/about.rdf"); | |
RepositoryConnection connection = ModelCommons.asRepository(response.getData()).getConnection(); | |
connection.begin(); | |
System.out.println("Triples retrieved: " + connection.size()); | |
connection.commit(); | |
connection.close(); |
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
from SPARQLWrapper import SPARQLWrapper, JSON, DIGEST | |
sparql = SPARQLWrapper("http://example.org/sparql") | |
sparql.setHTTPAuth(DIGEST) | |
sparql.setCredentials('login', 'password') | |
sparql.setQuery("...") | |
sparql.setReturnFormat(JSON) |
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
from SPARQLWrapper import SPARQLWrapper, JSON | |
sparql = SPARQLWrapper("http://dbpedia.org/sparql") | |
sparql.setQuery(""" | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT ?label | |
WHERE { <http://dbpedia.org/resource/Asturias> rdfs:label ?label } | |
""") | |
sparql.setReturnFormat(JSON) | |
results = sparql.query().convert() |
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
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | |
@prefix maront: <http://my.server.domain/ont/1/#> . | |
@prefix mar: <http://my.marmottaDB.domain/marmotta/resource/> . | |
mar:server a maront:linuxserver ; | |
maront:amountRamGB "4"^^xsd:decimal ; | |
maront:amountHDTB "2"^^xsd:decimal ; | |
maront:runs [ |
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
// load the certificate | |
InputStream fis = this.getClass().getResourceAsStream("/path/to/redlink-CA.crt"); | |
CertificateFactory cf = CertificateFactory.getInstance("X.509"); | |
Certificate cert = cf.generateCertificate(fis); | |
// load the keystore that includes self-signed cert as a "trusted" entry | |
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); | |
keyStore.load(null, null); | |
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); | |
keyStore.setCertificateEntry("redlink-CA", cert); |
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
from SPARQLWrapper import SPARQLWrapper, JSON | |
sparql = SPARQLWrapper("http://dbpedia.org/sparql") | |
sparql.setQuery(""" | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT ?label | |
WHERE { <http://dbpedia.org/resource/Asturias> rdfs:label ?label } | |
""") | |
sparql.setReturnFormat(JSON) |
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
from SPARQLWrapper import SPARQLWrapper, JSON | |
sparql = SPARQLWrapper("http://dbpedia.org/sparql") | |
sparql.setQuery(""" | |
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
SELECT ?label | |
WHERE { <http://dbpedia.org/resource/Asturias> rdfs:label ?label } | |
""") | |
sparql.setReturnFormat(JSON) | |
results = sparql.query().convert() |