Unable to load simple ontology

(Serge Colle) #1

I created a simple ontology using protege. however I am unable to load using the following command
stardog data add --named-graph http://topology/ontology Test ontology.ttl

My files look something like

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix asset: <http://topology/asset#> .
@base <http://www.w3.org/2002/07/owl#> .

[ rdf:type owl:Ontology
 ] .

#################################################################
#    Object Properties
#################################################################

###  http://topology/asset#consistsOf
asset:consistsOf rdf:type owl:ObjectProperty ;
                 owl:inverseOf asset:partOf .


###  http://topology/asset#partOf
asset:partOf rdf:type owl:ObjectProperty .


#################################################################
#    Classes
#################################################################

###  http://topology/asset#Device
asset:Device rdf:type owl:Class .


###  Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi

and I get the following error message

Adding data from file: ontology.ttl
An error occurred adding RDF to the index: C:\mnt\c\Users\serge.colle\Documents\git\rdf-workspace\ontology.ttl

The error logs shows the following

RROR 2019-04-25 12:29:59,052 [stardog-user-33] com.stardog.http.server.undertow.ErrorHandling:writeError(138): Unexpected error on the server
com.complexible.stardog.db.DatabaseException: An error occurred adding RDF to the index: C:\mnt\c\Users\serge.colle\Documents\git\rdf-workspace\ontology.ttl
	at com.complexible.stardog.db.DatabaseConnectionImpl.throwDatabaseException(DatabaseConnectionImpl.java:718) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.DatabaseConnectionImpl.add(DatabaseConnectionImpl.java:743) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.DelegatingDatabaseConnection.add(DelegatingDatabaseConnection.java:226) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.DatabaseImpl$DBConnectionWrapper.add(DatabaseImpl.java:1425) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.DelegatingDatabaseConnection.add(DelegatingDatabaseConnection.java:226) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.StardogKernel$KernelDbConnection.add(StardogKernel.java:3358) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.DelegatingDatabaseConnection.add(DelegatingDatabaseConnection.java:226) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.StardogKernel$NotifyingDatabaseConnection.add(StardogKernel.java:3454) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.protocols.http.server.TransactionService.lambda$null$2(TransactionService.java:187) ~[stardog-protocols-http-server-6.1.2.jar:?]
	at java.util.stream.Streams$StreamBuilderImpl.forEachRemaining(Unknown Source) ~[?:1.8.0_201]
	at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:1.8.0_201]
	at com.complexible.stardog.protocols.http.server.TransactionService.lambda$processUpdate$3(TransactionService.java:187) ~[stardog-protocols-http-server-6.1.2.jar:?]
	at com.complexible.stardog.protocols.http.server.TransactionService.processUpdate(TransactionService.java:213) ~[stardog-protocols-http-server-6.1.2.jar:?]
	at com.complexible.stardog.protocols.http.server.TransactionService.processUpdate(TransactionService.java:183) ~[stardog-protocols-http-server-6.1.2.jar:?]
	at com.complexible.stardog.protocols.http.server.TransactionService.add(TransactionService.java:170) ~[stardog-protocols-http-server-6.1.2.jar:?]
	at com.stardog.http.server.undertow.jaxrs.ExtractRoutes.lambda$handleIt$5(ExtractRoutes.java:192) ~[stardog-protocols-http-server-6.1.2.jar:?]
	at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120) [shiro-core-1.2.3.jar:1.2.3]
	at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108) [shiro-core-1.2.3.jar:1.2.3]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_201]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_201]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]
Caused by: com.complexible.stardog.StardogException: An error occurred adding RDF to the index: C:\mnt\c\Users\serge.colle\Documents\git\rdf-workspace\ontology.ttl
	at com.complexible.stardog.db.index.ConnectableIndexRWConnectionImpl$IndexResourceTransaction.apply(ConnectableIndexRWConnectionImpl.java:653) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.index.ConnectableIndexRWConnectionImpl.apply(ConnectableIndexRWConnectionImpl.java:376) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.ConnectableConnectionCollection.apply(ConnectableConnectionCollection.java:210) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.DatabaseConnectionImpl.add(DatabaseConnectionImpl.java:739) ~[stardog-6.1.2.jar:?]
	... 19 more
Caused by: com.complexible.stardog.index.IndexException: C:\mnt\c\Users\serge.colle\Documents\git\rdf-workspace\ontology.ttl
	at com.complexible.stardog.index.IndexWriterDataMapImpl.update(IndexWriterDataMapImpl.java:118) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.index.IndexWriterDataMapImpl.add(IndexWriterDataMapImpl.java:68) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.index.IndexWriterImpl.add(IndexWriterImpl.java:174) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.index.impl.DelegatingIndexWriter.add(DelegatingIndexWriter.java:51) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.index.Indexes.add(Indexes.java:378) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.index.ConnectableIndexRWConnectionImpl$IndexResourceTransaction.apply(ConnectableIndexRWConnectionImpl.java:637) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.index.ConnectableIndexRWConnectionImpl.apply(ConnectableIndexRWConnectionImpl.java:376) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.ConnectableConnectionCollection.apply(ConnectableConnectionCollection.java:210) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.DatabaseConnectionImpl.add(DatabaseConnectionImpl.java:739) ~[stardog-6.1.2.jar:?]
	... 19 more
Caused by: java.nio.file.NoSuchFileException: C:\mnt\c\Users\serge.colle\Documents\git\rdf-workspace\ontology.ttl
	at sun.nio.fs.WindowsException.translateToIOException(Unknown Source) ~[?:1.8.0_201]
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) ~[?:1.8.0_201]
	at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source) ~[?:1.8.0_201]
	at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(Unknown Source) ~[?:1.8.0_201]
	at java.nio.file.Files.newByteChannel(Unknown Source) ~[?:1.8.0_201]
	at java.nio.file.Files.newByteChannel(Unknown Source) ~[?:1.8.0_201]
	at java.nio.file.spi.FileSystemProvider.newInputStream(Unknown Source) ~[?:1.8.0_201]
	at java.nio.file.Files.newInputStream(Unknown Source) ~[?:1.8.0_201]
	at com.complexible.common.rdf.rio.RDFStreamBuilder$RDFFileStream.openInputStream(RDFStreamBuilder.java:387) ~[stardog-utils-rdf-6.1.2.jar:?]
	at com.complexible.common.rdf.rio.RDFStreamBuilder$RDFAbstractStream.parse(RDFStreamBuilder.java:208) ~[stardog-utils-rdf-6.1.2.jar:?]
	at com.complexible.common.rdf.rio.RDFStreamProcessor$ConcurrentLoadManagerImpl.add(RDFStreamProcessor.java:519) ~[stardog-utils-rdf-6.1.2.jar:?]
	at com.complexible.common.rdf.rio.RDFStreamProcessor.add(RDFStreamProcessor.java:236) ~[stardog-utils-rdf-6.1.2.jar:?]
	at com.complexible.stardog.index.IndexWriterDataMapImpl.update(IndexWriterDataMapImpl.java:113) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.index.IndexWriterDataMapImpl.add(IndexWriterDataMapImpl.java:68) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.index.IndexWriterImpl.add(IndexWriterImpl.java:174) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.index.impl.DelegatingIndexWriter.add(DelegatingIndexWriter.java:51) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.index.Indexes.add(Indexes.java:378) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.index.ConnectableIndexRWConnectionImpl$IndexResourceTransaction.apply(ConnectableIndexRWConnectionImpl.java:637) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.index.ConnectableIndexRWConnectionImpl.apply(ConnectableIndexRWConnectionImpl.java:376) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.ConnectableConnectionCollection.apply(ConnectableConnectionCollection.java:210) ~[stardog-6.1.2.jar:?]
	at com.complexible.stardog.db.DatabaseConnectionImpl.add(DatabaseConnectionImpl.java:739) ~[stardog-6.1.2.jar:?]
	... 19 more
(zachary.whitley) #2

Looks like it can't find the file. You might have a permission problem. It might need to be readable as the user that is running the server if you're running the client and server on localhost.

(system) closed #3

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.