From: Leo S. <leo...@df...> - 2008-05-07 15:49:25
|
It was Nico Heid who said at the right time 07.05.2008 16:35 the following words: > Hi, > But I have one follow up question. > If I look at the output -> container.getModel().writeTo(new PrintWriter(System.out),Syntax.Ntriples); > > I get something like this: (shortened) > > <myTest> <http://www.semanticdesktop.org/ontologies/2007/05/10/nid3#title> "Sonata No. 1 in F Minor, Op. 2 No. 1 - IV. Prestissimo" . > <myTest> <http://www.semanticdesktop.org/ontologies/2007/05/10/nid3#composer> <urn:uuid:17fb7051-55f8-4f50-ba73-9ad5ea9f5625> . > <urn:uuid:17fb7051-55f8-4f50-ba73-9ad5ea9f5625> <http://www.semanticdesktop.org/ontologies/2007/03/22/nco#fullname> "Ludwig van Beethoven" . > > > I don't quite understand this. I need to access composer. > But container.getString(NID3.composer) returns null; > The composer is represented as a resource, a kind of "resource-in-between" the string and the song. to get LudwigVan, you get the resource of the artist, then his fullname something like this (not tested, I used RDFContainer here for convenience, any other RDF way to walk the graph is ok) URI composer = container.getURI(NID3.composer); RDFContainer composerContainer = new RDFContainerImpl(container.getModel(), composer); String fullname = composerContainer.getString(NCO.fullname); hope this does the trick? The reason to model it this way is the flexibility of RDF. because other formats may split up fistname/secondname and also the composer is represented as a "contact", so its possible to add (in RDF) an address or something else to it. kind regards Leo > Nico > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Aperture-devel mailing list > Ape...@li... > https://lists.sourceforge.net/lists/listinfo/aperture-devel > -- ____________________________________________________ DI Leo Sauermann http://www.dfki.de/~sauermann Deutsches Forschungszentrum fuer Kuenstliche Intelligenz DFKI GmbH Trippstadter Strasse 122 P.O. Box 2080 Fon: +49 631 20575-116 D-67663 Kaiserslautern Fax: +49 631 20575-102 Germany Mail: leo...@df... Geschaeftsfuehrung: Prof.Dr.Dr.h.c.mult. Wolfgang Wahlster (Vorsitzender) Dr. Walter Olthoff Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes Amtsgericht Kaiserslautern, HRB 2313 ____________________________________________________ |