Frage

i eine RDF-Datei mit FOAF Vokabular haben, und ich will mit einer jsp die Datei anzuzeigen. Was muss ich dies für ??

OK Ich habe gerade die Nachricht von dem Lehrer, dass ich JSP und Jena verwenden muß ... ich die Datei erstellen und lesen mit servjet & jena, aber jetzt ist das Problem, wie die rdf-Datei mit jsp zeigen .. .für Beispiel, wenn ich ein Bild für eine Person habe, wie ich dies mit jsp zeigen kann ... kann ich SPARQL alle, die Freunde zu finden, aber nicht wissen, wie sie mit jsp zeigen ... zum Beispiel, wie das Ergebnis drucken von ResultSetFormatter.out (System.out.r, q) mit JSP ?? thx im Voraus für alle tipps

War es hilfreich?

Lösung

is it a static file ? what can of display do you want ? just echoing the XML ? you don't need the JSP. Just place your RDF file in a public place of your deployment folder. e.g: Deploying just HTML, CSS webpage to Tomcat

'''EDIT''': regarding your comment, I would associate a XSLT stylesheet to the RDF/XML file instead of processing the RDF via tomcat. See the source of my FOAF page: http://lindenb.github.com/foaf.xml

Andere Tipps

If you want just a readable version of the RDF/XML file one way is to apply and XSLT template.

You could do more sophisticated stuff if you load it with a library like Jena that provides different ways of querying and traversing the data.

In case your file is big and contains thousands or millions of triples then you might want to load it in a triple store like Virtuoso or 4store and use SPARQL to query your data.

If you explain a bit more your scenario we might be able to help better.

Do you really want to just visualize the RDF, or do you want to attach semantics to some other presentation? If the later, you want microformats.

In any case, RDF/XML is a pita, it's unlikely that you'll enjoy using XSLT to map it to any particular visual presentation. Better to write Java code using Jena, and just use JSP to render that as the HTML of your choice. Or turn it into JSON and render a graph with TheJIT.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top