From: SVN c. m. f. t. SWORD-A. p. <swo...@li...> - 2012-04-27 12:45:05
|
Revision: 505 http://sword-app.svn.sourceforge.net/sword-app/?rev=505&view=rev Author: richard-jones Date: 2012-04-27 12:44:54 +0000 (Fri, 27 Apr 2012) Log Message: ----------- Improved Statement support * Namespace prefixes in ORE formatted statement are now more sensible (i.e. "sword" and "ore" not "j.0", "j.1") * Author in atom feed is always set (fixes bug which didn't catch the empty string) Modified Paths: -------------- JavaServer2.0/trunk/src/main/java/org/swordapp/server/AtomStatement.java JavaServer2.0/trunk/src/main/java/org/swordapp/server/OREStatement.java JavaServer2.0/trunk/src/main/java/org/swordapp/server/UriRegistry.java Modified: JavaServer2.0/trunk/src/main/java/org/swordapp/server/AtomStatement.java =================================================================== --- JavaServer2.0/trunk/src/main/java/org/swordapp/server/AtomStatement.java 2012-04-26 16:17:19 UTC (rev 504) +++ JavaServer2.0/trunk/src/main/java/org/swordapp/server/AtomStatement.java 2012-04-27 12:44:54 UTC (rev 505) @@ -23,7 +23,7 @@ public AtomStatement(String feedUri, String author, String title, String updated) { this.contentType = "application/atom+xml;type=feed"; - this.author = author != null ? author : "Unknown"; + this.author = (author != null && !"".equals(author)) ? author : "Unknown"; this.feedUri = feedUri; this.title = title != null ? title : "Untitled"; this.updated = updated; Modified: JavaServer2.0/trunk/src/main/java/org/swordapp/server/OREStatement.java =================================================================== --- JavaServer2.0/trunk/src/main/java/org/swordapp/server/OREStatement.java 2012-04-26 16:17:19 UTC (rev 504) +++ JavaServer2.0/trunk/src/main/java/org/swordapp/server/OREStatement.java 2012-04-27 12:44:54 UTC (rev 505) @@ -31,10 +31,16 @@ // create the default model (in memory) to start with Model model = ModelFactory.createDefaultModel(); + // set up some sensible namespaces for the prefixes + model.setNsPrefix(UriRegistry.ORE_PREFIX, UriRegistry.ORE_NAMESPACE); + model.setNsPrefix(UriRegistry.SWORD_PREFIX, UriRegistry.SWORD_TERMS_NAMESPACE); + // create the resource map in the model Resource rem = model.createResource(this.remUri); rem.addProperty(RDF.type, model.createResource(UriRegistry.ORE_NAMESPACE + "ResourceMap")); + + // create the aggregation Resource agg = model.createResource(this.aggUri); agg.addProperty(RDF.type, model.createResource(UriRegistry.ORE_NAMESPACE + "Aggregation")); Modified: JavaServer2.0/trunk/src/main/java/org/swordapp/server/UriRegistry.java =================================================================== --- JavaServer2.0/trunk/src/main/java/org/swordapp/server/UriRegistry.java 2012-04-26 16:17:19 UTC (rev 504) +++ JavaServer2.0/trunk/src/main/java/org/swordapp/server/UriRegistry.java 2012-04-27 12:44:54 UTC (rev 505) @@ -4,6 +4,13 @@ public class UriRegistry { + // Namespace prefixes + public static String SWORD_PREFIX = "sword"; + public static String ORE_PREFIX = "ore"; + public static String APP_PREFIX = "app"; + public static String DC_PREFIX = "dcterms"; + public static String ATOM_PREFIX = "atom"; + // Namespaces public static String SWORD_TERMS_NAMESPACE = "http://purl.org/net/sword/terms/"; public static String APP_NAMESPACE = "http://www.w3.org/2007/app"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |