Skip to content

Commit 4da008b

Browse files
committed
GH-5709: added vocabularies typically used in EU projects
1 parent d874f67 commit 4da008b

25 files changed

Lines changed: 5619 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2020 Eclipse RDF4J contributors.
3+
*
4+
* All rights reserved. This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Distribution License v1.0
6+
* which accompanies this distribution, and is available at
7+
* http://www.eclipse.org/org/documents/edl-v10.php.
8+
*
9+
* SPDX-License-Identifier: BSD-3-Clause
10+
*******************************************************************************/
11+
12+
package org.eclipse.rdf4j.model.base;
13+
14+
import org.eclipse.rdf4j.common.annotation.InternalUseOnly;
15+
import org.eclipse.rdf4j.model.IRI;
16+
import org.eclipse.rdf4j.model.Namespace;
17+
18+
/**
19+
* Utility methods related to RDF vocabularies.
20+
*
21+
* @author Alessandro Bollini
22+
* @implNote To be eventually removed or merged with {@code org.eclipse.rdf4j.model.util.Vocabularies}.
23+
* @since 3.5.0
24+
*/
25+
@InternalUseOnly
26+
public final class Vocabularies {
27+
28+
private Vocabularies() {
29+
}
30+
31+
/**
32+
* Create a new vocabulary namespace
33+
*
34+
* @param prefix prefix
35+
* @param namespace full namespace
36+
* @return
37+
*/
38+
public static Namespace createNamespace(String prefix, String namespace) {
39+
return new VocabularyNamespace(prefix, namespace);
40+
}
41+
42+
private static class VocabularyNamespace extends AbstractNamespace {
43+
44+
private final String prefix;
45+
private final String namespace;
46+
47+
public VocabularyNamespace(String prefix, String namespace) {
48+
49+
this.prefix = prefix;
50+
this.namespace = namespace;
51+
}
52+
53+
@Override
54+
public String getPrefix() {
55+
return prefix;
56+
}
57+
58+
@Override
59+
public String getName() {
60+
return namespace;
61+
}
62+
}
63+
64+
/**
65+
* Create an (interned) IRI
66+
*
67+
* @param namespace
68+
* @param localName
69+
* @return
70+
*/
71+
public static IRI createIRI(String namespace, String localName) {
72+
return new InternedIRI(namespace, localName);
73+
}
74+
75+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<parent>
5+
<groupId>org.eclipse.rdf4j</groupId>
6+
<artifactId>rdf4j-core</artifactId>
7+
<version>6.0.0-SNAPSHOT</version>
8+
</parent>
9+
<artifactId>rdf4j-model-vocabulary-annotation</artifactId>
10+
<packaging>jar</packaging>
11+
<name>RDF4J: RDF Vocabularies Annotation</name>
12+
<description>Well-known RDF Vocabularies for annotations, feedback etc</description>
13+
<dependencies>
14+
<dependency>
15+
<groupId>${project.groupId}</groupId>
16+
<artifactId>rdf4j-model-api</artifactId>
17+
<version>${project.version}</version>
18+
</dependency>
19+
</dependencies>
20+
</project>

0 commit comments

Comments
 (0)