01 /*
02 * Utils.java
03 *
04 * $Id: Utils.java 11598 2009-10-13 13:44:17Z johann_p $
05 */
06 package gate.creole.ontology;
07
08 /**
09 *
10 * @author Johann Petrak
11 */
12 public class Utils {
13
14 // TODO: only used in the gui .. move?
15 @Deprecated
16 public static boolean hasSystemNameSpace(String uri) {
17 if(uri.startsWith("http://www.w3.org/2002/07/owl#")) {
18 return true;
19 } else if(uri.startsWith("http://www.w3.org/2001/XMLSchema#")) {
20 return true;
21 } else if(uri.startsWith("http://www.w3.org/2000/01/rdf-schema#")) {
22 return true;
23 } else if(uri.startsWith("http://www.w3.org/1999/02/22-rdf-syntax-ns#")) {
24 return true;
25 } else {
26 return false;
27 }
28 }
29
30 // TODO: it seems this is only used for the GUI ... move?
31 @Deprecated
32 public static String getRestrictionName(Restriction res) {
33 String className = "Unknown";
34 if(res instanceof HasValueRestriction) {
35 className = "http://www.w3.org/2002/07/owl#hasValue";
36 } else if(res instanceof AllValuesFromRestriction) {
37 className = "http://www.w3.org/2002/07/owl#allValuesFrom";
38 } else if(res instanceof SomeValuesFromRestriction) {
39 className = "http://www.w3.org/2002/07/owl#someValuesFrom";
40 } else if(res instanceof CardinalityRestriction) {
41 className = "http://www.w3.org/2002/07/owl#cardinality";
42 } else if(res instanceof MinCardinalityRestriction) {
43 className = "http://www.w3.org/2002/07/owl#minCardinality";
44 } else if(res instanceof MaxCardinalityRestriction) {
45 className = "http://www.w3.org/2002/07/owl#maxCardinality";
46 } else if(res instanceof AnonymousClass) {
47 className = "Annonymous";
48 }
49 return className;
50 }
51
52 }
53
|