/emotionml-checker-java

A generic implementation of EmotionML checks, in Java

Primary LanguageJavaCreative Commons Zero v1.0 UniversalCC0-1.0

emotionml-checker-java

CI

A generic implementation of EmotionML checks, in Java.

Dependency resolution

Releases

As of v1.2.1, release artifacts for this component is available via Maven Central.

Gradle

Add this to your build.gradle:

repositories {
    mavenCentral()
}

dependencies {
    implementation group: 'de.dfki.mary', name: 'emotionml-checker-java', version: '1.2.1'
}

Maven

Add this to your pom.xml:

<dependency>
    <groupId>de.dfki.mary</groupId>
    <artifactId>emotionml-checker-java</artifactId>
    <version>1.2.1</version>
</dependency>

Snapshots

Snapshot releases are hosted via GitHub Packages.

Ensure you have a valid GitHub personal access token with read:packages scope.

Gradle

Configure your GitHub username and token as Gradle properties GitHubPackagesUsername and GitHubPackagesPassword, respectively.

Then, add this to your build.gradle:

repositories {
    exclusiveContent {
        forRepository {
            maven {
                name 'GitHubPackages'
                url 'https://maven.pkg.github.com/marytts/emotionml-checker-java'
                credentials PasswordCredentials
            }
        }
        filter {
            includeModule 'de.dfki.mary', 'emotionml-checker-java'
        }
    }
}

dependencies {
    implementation group: 'de.dfki.mary', name: 'emotionml-checker-java', version: '1.3-SNAPSHOT'
}

Maven

Configure your Maven settings.xml to authenticate to GitHub Packages.

Then, add this to your pom.xml:

<dependency>
    <groupId>de.dfki.mary</groupId>
    <artifactId>emotionml-checker-java</artifactId>
    <version>1.3-SNAPSHOT</version>
</dependency>

Building

Run

./gradlew build

Command line usage

The EmotionML checker can be used to verify the validity of a set of EmotionML files as follows:

java -jar emotionml-checker-java.jar file.emotionml [more emotionml files]

where file.emotionml is an XML file containing the EmotionML document to be validated.

The tool will print for each file either an "ok" or a validation error message.

API usage

Key APIs to use from Java code are the following.

To verify that a given XML document is valid EmotionML:

new Checker().parse(InputStream);
new Checker().validate(Document);
new Checker().validateFragment(DocumentFragment);

To obtain a certain Emotion Vocabulary:

EmotionVocabulary.get(String vocabularyUriWithId);

To inquire about properties of an Emotion Vocabulary:

vocabulary.getType()
vocabulary.getItems()