Last active
September 17, 2021 17:09
-
-
Save nickform-ost/8ff6c3e34450d15f85413e3bd9384774 to your computer and use it in GitHub Desktop.
Initializing an RDFox Server Directory with JRDFox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.example.jrdfox; | |
import java.util.HashMap; | |
import java.util.Map; | |
import tech.oxfordsemantic.jrdfox.client.ConnectionFactory; | |
public class ServerDirectoryInitializationDemo { | |
public static void main(String[] args) throws Exception { | |
Map<String,String> serverParameters = new HashMap<>(); | |
serverParameters.put("persist-ds" , "file" ); | |
serverParameters.put("persist-roles" , "file" ); | |
serverParameters.put("server-directory", "/var/lib/RDFox/data" ); | |
String[] warnings = ConnectionFactory.startLocalServer(serverParameters); | |
/* ... handle warnings ... */ | |
if (ConnectionFactory.getNumberOfLocalServerRoles() == 0) { | |
System.out.println("Initializing server directory..."); | |
ConnectionFactory.createFirstLocalServerRole("admin", "****"); | |
} | |
else { | |
System.out.println("Server directory is already initialized!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment