Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*******************************************************************************
* Copyright (c) 2020 Eclipse RDF4J contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/

package org.eclipse.rdf4j.model.base;

import org.eclipse.rdf4j.common.annotation.InternalUseOnly;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.model.Namespace;

/**
* Utility methods related to RDF vocabularies.
*
* @author Alessandro Bollini
* @implNote To be eventually removed or merged with {@code org.eclipse.rdf4j.model.util.Vocabularies}.
* @since 3.5.0
*/
@InternalUseOnly
public final class Vocabularies {

private Vocabularies() {
}

/**
* Create a new vocabulary namespace
*
* @param prefix prefix
* @param namespace full namespace
* @return
*/
public static Namespace createNamespace(String prefix, String namespace) {
return new VocabularyNamespace(prefix, namespace);
}

private static class VocabularyNamespace extends AbstractNamespace {

private final String prefix;
private final String namespace;

public VocabularyNamespace(String prefix, String namespace) {

this.prefix = prefix;
this.namespace = namespace;
}

@Override
public String getPrefix() {
return prefix;
}

@Override
public String getName() {
return namespace;
}
}

/**
* Create an (interned) IRI
*
* @param namespace
* @param localName
* @return
*/
public static IRI createIRI(String namespace, String localName) {
return new InternedIRI(namespace, localName);
}

}
20 changes: 20 additions & 0 deletions core/model-vocabulary-annotation/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.rdf4j</groupId>
<artifactId>rdf4j-core</artifactId>
<version>6.0.0-SNAPSHOT</version>
</parent>
<artifactId>rdf4j-model-vocabulary-annotation</artifactId>
<packaging>jar</packaging>
<name>RDF4J: RDF Vocabularies Annotation</name>
<description>Well-known RDF Vocabularies for annotations, feedback etc</description>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>rdf4j-model-api</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
Loading
Loading