20
20
/**
21
21
* RDF vocabularies of the SAMM meta model namespaces
22
22
*/
23
+ @ SuppressWarnings ( { "checkstyle:AbbreviationAsWordInName" , "checkstyle:MethodName" } ) // RDF vocabularies are exempt from naming rules
23
24
public class SammNs {
24
25
public static final SAMM SAMM = new SAMM ( KnownVersion .getLatest () );
25
26
public static final SAMMC SAMMC = new SAMMC ( KnownVersion .getLatest () );
26
27
public static final SAMME SAMME = new SAMME ( KnownVersion .getLatest (), SAMM );
27
28
public static final UNIT UNIT = new UNIT ( KnownVersion .getLatest (), SAMM );
28
- public static final RdfNamespace RDF = new SimpleRdfNamespace ( "rdf" , org .apache .jena .vocabulary .RDF .getURI () );
29
- public static final RdfNamespace RDFS = new SimpleRdfNamespace ( "rdfs" , org .apache .jena .vocabulary .RDFS .getURI () );
30
- public static final RdfNamespace XSD = new SimpleRdfNamespace ( "xsd" , org .apache .jena .vocabulary .XSD .getURI () );
29
+
30
+ private static RdfNamespace RDF ;
31
+ private static RdfNamespace RDFS ;
32
+ private static RdfNamespace XSD ;
31
33
32
34
private SammNs () {
33
35
}
@@ -41,12 +43,33 @@ public static Stream<RdfNamespace> sammNamespaces() {
41
43
return Stream .of ( SAMM , SAMMC , SAMME , UNIT );
42
44
}
43
45
46
+ public static synchronized RdfNamespace RDF () {
47
+ if ( RDF == null ) {
48
+ RDF = new SimpleRdfNamespace ( "rdf" , org .apache .jena .vocabulary .RDF .getURI () );
49
+ }
50
+ return RDF ;
51
+ }
52
+
53
+ public static synchronized RdfNamespace RDFS () {
54
+ if ( RDFS == null ) {
55
+ RDFS = new SimpleRdfNamespace ( "rdfs" , org .apache .jena .vocabulary .RDFS .getURI () );
56
+ }
57
+ return RDFS ;
58
+ }
59
+
60
+ public static synchronized RdfNamespace XSD () {
61
+ if ( XSD == null ) {
62
+ XSD = new SimpleRdfNamespace ( "xsd" , org .apache .jena .vocabulary .XSD .getURI () );
63
+ }
64
+ return XSD ;
65
+ }
66
+
44
67
/**
45
68
* All "well-known" RDF namespaces
46
69
*
47
70
* @return the namespaces
48
71
*/
49
72
public static Stream <RdfNamespace > wellKnownNamespaces () {
50
- return Stream .concat ( sammNamespaces (), Stream .of ( RDF , RDFS , XSD ) );
73
+ return Stream .concat ( sammNamespaces (), Stream .of ( RDF () , RDFS () , XSD () ) );
51
74
}
52
75
}
0 commit comments