51 |
} |
} |
52 |
|
|
53 |
/** Get the set of all properties of all statements in a model. |
/** Get the set of all properties of all statements in a model. |
|
* Omitted from this are the 'numeric' properties: |
|
|
* rdf:_1, rdf:_2 etc. |
|
54 |
*/ |
*/ |
55 |
public static Set getProperties(Model m) throws RDFException { |
public static Set getProperties(Model m) throws RDFException { |
56 |
Set properties = new HashSet(); |
Set properties = new HashSet(); |
59 |
for(StmtIterator iter = m.listStatements(); iter.hasNext();) { |
for(StmtIterator iter = m.listStatements(); iter.hasNext();) { |
60 |
Statement stmt = iter.next(); |
Statement stmt = iter.next(); |
61 |
Property p = stmt.getPredicate(); |
Property p = stmt.getPredicate(); |
62 |
if(!rdf.isNumericProperty(p)) |
properties.add(p); |
|
properties.add(p); |
|
63 |
} |
} |
64 |
|
|
65 |
return properties; |
return properties; |
66 |
} |
} |
67 |
|
|
68 |
|
/** |
69 |
|
*/ |
70 |
|
public static Set getNonNumericProperties(Model m) |
71 |
|
throws RDFException { |
72 |
|
|
73 |
|
Set s = getProperties(m); |
74 |
|
for(Iterator i=s.iterator(); i.hasNext();) |
75 |
|
if(RDFVocab.isNumericProperty((Property)i.next())) |
76 |
|
i.remove(); |
77 |
|
return s; |
78 |
|
} |
79 |
} |
} |