72 |
throw new Error("ShortRDF has RDFException!"); |
throw new Error("ShortRDF has RDFException!"); |
73 |
}} |
}} |
74 |
|
|
75 |
|
|
76 |
|
static public RDFNode newNode(Model model) { |
77 |
|
return newNode(model, null); |
78 |
|
} |
79 |
|
static public RDFNode newNode(Model model, RDFNode object) |
80 |
|
{ try { |
81 |
|
String uri = URN5Namespace.instance.generateId(); |
82 |
|
if (object == null) { |
83 |
|
return model.createResource(uri); |
84 |
|
} else { |
85 |
|
Resource res = model.createResource(uri); |
86 |
|
res.addProperty(RDF.type, (Resource)object); |
87 |
|
return res; |
88 |
|
} |
89 |
|
} catch (RDFException e) { |
90 |
|
pa("Exception ocurred!: "+e); |
91 |
|
throw new Error("ShortRDF has RDFException!"); |
92 |
|
}} |
93 |
|
|
94 |
|
static public RDFNode newNode(Model model, RDFNode node, Property property) |
95 |
|
{ try { |
96 |
|
String uri = URN5Namespace.instance.generateId(); |
97 |
|
Resource res = model.createResource(uri); |
98 |
|
|
99 |
|
((Resource)node).addProperty(property, res); |
100 |
|
return res; |
101 |
|
|
102 |
|
} catch (RDFException e) { |
103 |
|
pa("Exception ocurred!: "+e); |
104 |
|
throw new Error("ShortRDF has RDFException!"); |
105 |
|
}} |
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
} |
} |