Skip to content

Instantly share code, notes, and snippets.

Kendall Clark kendall

Block or report user

Report or block kendall

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sparql-dl-pellet-syntax.sparql
#
# To query for all individuals that have an age between 18 and 37 (exclusive)
# in Pellet 2.0, you have to write (ignoring PREFIXes for now):
#
SELECT ?x
WHERE
{ ?x a [ a owl:Restriction ;
owl:onProperty :age ;
owl:someValuesFrom [
View gist:393544
Graph aGraph = new GraphImpl();
URI aBook = aGraph.getValueFactory().createURI("urn:x-domain:oreilly.com:product:9780596514129.IP");
aGraph.add(aBook,
aGraph.getValueFactory().createURI("http://purl.org/dc/terms/publisher"),
aGraph.getValueFactory().createLiteral("O'Reilly Media / Pogue Press"));
aGraph.add(aBook,
aGraph.getValueFactory().createURI("http://purl.org/dc/terms/title"),
aGraph.getValueFactory().createLiteral("Switching to the Mac: The Missing Manual, Leopard Edition"));
// ... setting the additional properties here ...
View gist:393549
Graph aGraph = new GraphImpl();
URI aBook = aGraph.getValueFactory().createURI("urn:x-domain:oreilly.com:product:9780596514129.IP");
aGraph.add(aBook,
aGraph.getValueFactory().createURI("http://purl.org/dc/terms/publisher"),
aGraph.getValueFactory().createLiteral("O'Reilly Media / Pogue Press"));
aGraph.add(aBook,
aGraph.getValueFactory().createURI("http://purl.org/dc/terms/title"),
aGraph.getValueFactory().createLiteral(
"Switching to the Mac: The Missing Manual, Leopard Edition"));
View Sample data
<rdf:Description rdf:about="urn:x-domain:oreilly.com:product:9780596514129.IP">
<foaf1:primarySubjectOf rdf:resource="http://oreilly.com/catalog/9780596514129"/>
<dc1:title xml:lang="en">Switching to the Mac: The Missing Manual, Leopard Edition</dc1:title>
<dc1:title>Switching to the Mac: The Missing Manual, Leopard Edition</dc1:title>
<dc1:creator rdf:resource="urn:x-domain:oreilly.com:agent:pdb:350"/>
<dc1:publisher xml:lang="en">O'Reilly Media / Pogue Press</dc1:publisher>
<dc1:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2008-02-26</dc1:issued>
<frbr1:embodiment rdf:resource="urn:x-domain:oreilly.com:product:9780596514129.BOOK"/>
<frbr1:embodiment rdf:resource="urn:x-domain:oreilly.com:product:9780596802899.EBOOK"/>
<frbr1:embodiment rdf:resource="urn:x-domain:oreilly.com:product:9780596514129.SAF"/>
View java-beans.java
Book aBook = new Book();
aBook.setTitle("Switching to the Mac: The Missing Manual, Leopard Edition");
aBook.setPublisher("O'Reilly Media / Pogue Press");
aBook.setIssueDate("2008-02-26");
// And so on...
View jpa.java
@Entity
public class Book
View empire.java
@Namespaces({"frbr", "http://vocab.org/frbr/core#"})
@Entity
@RdfsClass("frbr:Expression")
public class Book
View rdf-id.java
// ... annotations ...
public class Book implements SupportsRdfId
View empire-2.java
private String title;
private String publisher;
private Date issued;
View empire-3.java
@OneToMany(fetch = FetchType.LAZY,
cascade = {CascadeType.PERSIST, CascadeType.MERGE})
private Collection<Manifestation> mEmbodiments = new HashSet<Manifestation>();
You can’t perform that action at this time.