Reputation: 530
When I run the example from the docs(https://jena.apache.org/documentation/ontology/): I get following error:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
My code:
public static void main(String[] args) {
// TODO Auto-generated method stub
String SOURCE = "http://www.eswc2006.org/technologies/ontology";
String NS = SOURCE + "#";
OntDocumentManager mgr = new OntDocumentManager();
OntModel m = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM );
Model base = m.getBaseModel();
String path = System.getProperty("user.home") + "/Desktop/people.owl";
OntDocumentManager dm = m.getDocumentManager();
dm.addAltEntry( "http://www.eswc2006.org/technologies/ontology",
"file:" +path );
Resource mass = m.createResource("http://somewhere/Testressource");
mass.addProperty(VCARD.FN, "test");
m.write(System.out);
}
I only have jena as a maven dependency
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>jena</groupId>
<artifactId>jena-id</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>apache-jena-libs</artifactId>
<type>pom</type>
<version>4.4.0</version>
</dependency>
</dependencies>
</project>
Upvotes: 2
Views: 3130
Reputation: 16700
You need to add a logging implementation to your application.
apache-jena-libs is a library; it uses slf4j as an API to abstract way from the choice of logging.
Example:
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.17.2</version>
</dependency>
Upvotes: 3