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
package harschware.drivers; | |
import org.openrdf.model.Statement; | |
import org.openrdf.model.URI; | |
import org.openrdf.model.ValueFactory; | |
import org.openrdf.repository.RepositoryConnection; | |
import org.openrdf.repository.RepositoryException; | |
import org.openrdf.repository.RepositoryResult; | |
import org.openrdf.repository.sparql.SPARQLRepository; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
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
package com.cray.utils; | |
import java.io.StringWriter; | |
import javax.xml.transform.Result; | |
import javax.xml.transform.Transformer; | |
import javax.xml.transform.TransformerConfigurationException; | |
import javax.xml.transform.TransformerException; | |
import javax.xml.transform.TransformerFactory; | |
import javax.xml.transform.dom.DOMSource; |
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 ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#> | |
PREFIX cray: <http://www.cray.com/ontologies/lebm#> | |
SELECT * | |
WHERE { | |
?n0 cray:hasFriend ?n1 . | |
?n1 cray:hasFriend ?n0 . | |
?n0 ub:takesCourse ?n3 . | |
?n1 ub:takesCourse ?n3 . | |
} |
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
package testejena; | |
import com.hp.hpl.jena.ontology.OntClass; | |
import com.hp.hpl.jena.ontology.OntModel; | |
import com.hp.hpl.jena.rdf.model.ModelFactory; | |
import com.hp.hpl.jena.util.FileManager; | |
import com.hp.hpl.jena.util.iterator.ExtendedIterator; | |
import java.io.InputStream; | |
import java.util.Iterator; |
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
// adapted from stackoverflow post: http://stackoverflow.com/questions/3233645/read-multiples-lines-from-file-to-a-string-in-c/3233744#3233744 by user http://stackoverflow.com/users/346905/faisal | |
char * readFile( const char * fileName ) { | |
// open the file | |
FILE* fp = fopen( fileName, "r"); | |
if (fp == NULL) { | |
fprintf(stderr,"ERROR: couldn't open file\n"); | |
exit(1); | |
} |
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
##### Found this query in an email posted by @kidehen (since lost to me) | |
##### query LOD cloud at http://lod.openlinksw.com/sparql/ | |
##### -or- via iSPARQL at http://lod.openlinksw.com/isparql/ <== can use Google maps to visualize | |
### construct a custom Linked Data Mesh (graph) about: | |
### places of worship, within 5 km of Paris, that have cafes in close proximity(0.2 km) | |
### Note: we have distinct pin colors that identify for places of worship distinct from cafes | |
PREFIX rtb: <http://www.openlinksw.com/schemas/oat/rdftabs#> | |
CONSTRUCT { ?cafe geo:geometry ?cafegeo ; | |
rtb:useMarker '01' ; |
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
# Saved by TopBraid on Tue Mar 08 08:20:27 PST 2011 | |
# baseURI: http://example.org/unnamed0 | |
@prefix : <http://example.org/unnamed0#> . | |
@prefix owl: <http://www.w3.org/2002/07/owl#> . | |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
@prefix univ-bench: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#> . | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . |
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
<?xml version="1.0"?> | |
<rdf:RDF | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:univ-bench="http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#" | |
xmlns:owl="http://www.w3.org/2002/07/owl#" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" | |
xmlns="http://example.org/unnamed0#" | |
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" | |
xml:base="http://example.org/unnamed0"> | |
<Uncle rdf:ID="UncleSam"> |
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
package harsch.sandbox; | |
import org.apache.commons.lang.builder.CompareToBuilder; | |
import org.apache.commons.lang.builder.HashCodeBuilder; | |
/** | |
* | |
* @author Tim Harsch | |
* | |
* @param <L> |
NewerOlder