84 |
if (object == null) { |
if (object == null) { |
85 |
return model.createResource(uri); |
return model.createResource(uri); |
86 |
} else { |
} else { |
87 |
|
pa("JOU!"+object); |
88 |
Resource res = model.createResource(uri); |
Resource res = model.createResource(uri); |
89 |
res.addProperty(RDF.type, (Resource)object); |
res.addProperty(RDF.type, (Resource)object); |
90 |
return res; |
return res; |
109 |
throw new Error("ShortRDF has RDFException!"); |
throw new Error("ShortRDF has RDFException!"); |
110 |
}} |
}} |
111 |
|
|
112 |
|
/** old -pred-> new |
113 |
|
*/ |
114 |
|
static public RDFNode newNode(Model model, RDFNode node, Property property, RDFNode type) |
115 |
|
{ try { |
116 |
|
String uri = URN5Namespace.instance.generateId(); |
117 |
|
Resource res = model.createResource(uri); |
118 |
|
|
119 |
|
((Resource)node).addProperty(property, res); |
120 |
|
res.addProperty(RDF.type, (Resource)type); |
121 |
|
return res; |
122 |
|
|
123 |
|
} catch (RDFException e) { |
124 |
|
pa("Exception ocurred!: "+e); |
125 |
|
throw new Error("ShortRDF has RDFException!"); |
126 |
|
}} |
127 |
|
|
128 |
|
|
129 |
|
|
130 |
/** New -pred-> old |
/** New -pred-> old |
131 |
*/ |
*/ |
132 |
static public RDFNode newNodeToNode(Model model, RDFNode node, Property property) |
static public RDFNode newNodeToNode(Model model, RDFNode node, Property property) |