summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Pitschke2013-07-23 09:16:57 (EDT)
committer Samuel Padgett2013-07-24 16:56:28 (EDT)
commita6c3adfa25b912da75a56e3c78b5f0b587fc9dbe (patch)
tree154c27cc25b0a7e6697d40146d87efa68d39c3f5
parenteb920d8a0c02443a88e45d0b375f9430c6dd491e (diff)
downloadorg.eclipse.lyo.core-a6c3adfa25b912da75a56e3c78b5f0b587fc9dbe.zip
org.eclipse.lyo.core-a6c3adfa25b912da75a56e3c78b5f0b587fc9dbe.tar.gz
org.eclipse.lyo.core-a6c3adfa25b912da75a56e3c78b5f0b587fc9dbe.tar.bz2
Bug 413679: JSON provider does not ignore missing IReifiedResource rdf:resourcerefs/changes/93/14793/2
When ignoring missing property definitions for rdf:about and rdf:types, also ignore rdf:resource for IReifiedResources. Signed-off-by: Steve Pitschke <pitschke@us.ibm.com>
-rw-r--r--org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
index 3432281..93f29b8 100644
--- a/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
+++ b/org.eclipse.lyo.oslc4j.provider.json4j/src/org/eclipse/lyo/oslc4j/provider/json4j/JsonHelper.java
@@ -104,9 +104,10 @@ public final class JsonHelper
private static final String JSON_PROPERTY_SUFFIX_BAG = "Bag";
private static final String JSON_PROPERTY_SUFFIX_SEQ = "Seq";
- private static final String RDF_ABOUT_URI = OslcConstants.RDF_NAMESPACE + JSON_PROPERTY_SUFFIX_ABOUT;
- private static final String RDF_TYPE_URI = OslcConstants.RDF_NAMESPACE + JSON_PROPERTY_SUFFIX_TYPE;
- private static final String RDF_NIL_URI = OslcConstants.RDF_NAMESPACE + JSON_PROPERTY_SUFFIX_NIL;
+ private static final String RDF_ABOUT_URI = OslcConstants.RDF_NAMESPACE + JSON_PROPERTY_SUFFIX_ABOUT;
+ private static final String RDF_TYPE_URI = OslcConstants.RDF_NAMESPACE + JSON_PROPERTY_SUFFIX_TYPE;
+ private static final String RDF_NIL_URI = OslcConstants.RDF_NAMESPACE + JSON_PROPERTY_SUFFIX_NIL;
+ private static final String RDF_RESOURCE_URI = OslcConstants.RDF_NAMESPACE + JSON_PROPERTY_SUFFIX_RESOURCE;
private static final String METHOD_NAME_START_GET = "get";
private static final String METHOD_NAME_START_IS = "is";
@@ -1350,6 +1351,8 @@ public final class JsonHelper
setMethodMap);
}
+ boolean isIReifiedResource = false;
+
if (bean instanceof IResource)
{
final Object aboutURIObject = jsonObject.opt(rdfPrefix + JSON_PROPERTY_DELIMITER + JSON_PROPERTY_SUFFIX_ABOUT);
@@ -1370,6 +1373,8 @@ public final class JsonHelper
}
else if (bean instanceof IReifiedResource)
{
+ isIReifiedResource = true;
+
@SuppressWarnings("unchecked")
final IReifiedResource<Object> reifiedResource = (IReifiedResource<Object>) bean;
String resourceReference;
@@ -1443,9 +1448,11 @@ public final class JsonHelper
final Method setMethod = setMethodMap.get(propertyDefinition);
if (setMethod == null)
{
- if (RDF_ABOUT_URI.equals(propertyDefinition))
+ if (RDF_ABOUT_URI.equals(propertyDefinition) ||
+ (isIReifiedResource && RDF_RESOURCE_URI.equals(propertyDefinition)))
{
- // Ignore missing property definitions for rdf:about and rdf:types.
+ // Ignore missing property definitions for rdf:about, rdf:types and
+ // rdf:resource for IReifiedResources.
}
else if (RDF_TYPE_URI.equals(propertyDefinition))
{