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
Book aBook = aManager.find(Book.class, URI.create("urn:x-domain:oreilly.com:product:9780596514129.IP")); | |
// prints: Switching to the Mac: The Missing Manual, Leopard Edition | |
System.err.println(aBook.getTitle()); | |
// prints: O'Reilly Media / Pogue Press | |
System.err.println(aBook.getPublisher()); |
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
EntityManager aManager = Persistence.createEntityManagerFactory("oreilly") | |
.createEntityManager(); |
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
Empire.init(new OpenRdfEmpireModule()); |
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
@RdfProperty("dc:title") | |
private String title; | |
@RdfProperty("dc:publisher") | |
private String publisher; | |
@RdfProperty("dc:issued") | |
private Date issued; | |
@RdfProperty("frbr:embodiment") |
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
@OneToMany(fetch = FetchType.LAZY, | |
cascade = {CascadeType.PERSIST, CascadeType.MERGE}) | |
private Collection<Manifestation> mEmbodiments = new HashSet<Manifestation>(); |
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
private String title; | |
private String publisher; | |
private Date issued; |
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
// ... annotations ... | |
public class Book implements SupportsRdfId |
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
@Namespaces({"frbr", "http://vocab.org/frbr/core#"}) | |
@Entity | |
@RdfsClass("frbr:Expression") | |
public class Book |
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
@Entity | |
public class Book |
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
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... |