ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
502 stars 61 forks source link

SQL: `IMPORT DATABASE` RDF problems #1278

Open gramian opened 1 year ago

gramian commented 1 year ago

ArcadeDB Version:

ArcadeDB Server v23.10.1-SNAPSHOT (build 10807a67289db1e4d813e62e20312f61cfac602c/1697493770415/main)

OS and JDK Version:

Running on Mac OS X 12.7 - OpenJDK 64-Bit Server VM 17.0.8.1 (Homebrew)

Expected behavior

Error-free import

Actual behavior

Cannot execute command Error on parsing source 'file:///path/to/test.rdf (compressed=false size=646)' ``` 2023-10-17 15:10:15.037 INFO [SourceDiscovery] Analyzing url: file:///path/to/test.rdf... 2023-10-17 15:10:15.042 INFO [SourceDiscovery] Recognized format XML (parsingLimitBytes=9,54MB parsingLimitEntries=0) 2023-10-17 15:10:15.043 INFO [Importer] Checking schema...Parsed 1 (1/sec 100%) 0 records (0/sec) 0 vertices (0/sec) 0 edges (0/sec 0 skipped) 0 linked edges (0/sec 0%) updated documents 0 (0%) Error on command execution (PostCommandHandler) com.arcadedb.exception.CommandExecutionException: Error on importing database at com.arcadedb.query.sql.parser.ImportDatabaseStatement.executeSimple(ImportDatabaseStatement.java:69) at com.arcadedb.query.sql.executor.SingleOpExecutionPlan.executeInternal(SingleOpExecutionPlan.java:91) at com.arcadedb.query.sql.parser.SimpleExecStatement.execute(SimpleExecStatement.java:64) at com.arcadedb.query.sql.parser.Statement.execute(Statement.java:73) at com.arcadedb.query.sql.SQLQueryEngine.command(SQLQueryEngine.java:101) at com.arcadedb.database.EmbeddedDatabase.command(EmbeddedDatabase.java:1334) at com.arcadedb.server.ServerDatabase.command(ServerDatabase.java:467) at com.arcadedb.server.http.handler.PostCommandHandler.executeCommand(PostCommandHandler.java:123) at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:91) at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:99) at com.arcadedb.server.http.handler.AbstractHandler.handleRequest(AbstractHandler.java:126) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:393) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) at org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1282) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: com.arcadedb.integration.importer.ImportException: Error on parsing source 'file:///path/to/test.rdf (compressed=false size=646)' at com.arcadedb.integration.importer.Importer.load(Importer.java:63) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at com.arcadedb.query.sql.parser.ImportDatabaseStatement.executeSimple(ImportDatabaseStatement.java:61) ... 17 more Caused by: com.arcadedb.integration.importer.ImportException: Error on importing from source 'file:///path/to/test.rdf (compressed=false size=646)' at com.arcadedb.integration.importer.format.XMLImporterFormat.load(XMLImporterFormat.java:138) at com.arcadedb.integration.importer.Importer.loadFromSource(Importer.java:95) at com.arcadedb.integration.importer.Importer.load(Importer.java:54) ... 22 more Caused by: com.arcadedb.exception.SchemaException: Type with name 'v_{http://www.w3.org/1999/02/22-rdf-syntax-ns#}Description' was not found at com.arcadedb.schema.EmbeddedSchema.getType(EmbeddedSchema.java:639) at com.arcadedb.database.EmbeddedDatabase.newVertex(EmbeddedDatabase.java:1153) at com.arcadedb.integration.importer.format.XMLImporterFormat.load(XMLImporterFormat.java:106) ... 24 more ```

Steps to reproduce

IMPORT DATABASE file:///path/to/test.rdf

with the test.rdf

<?xml version="1.0"?>

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cd="http://www.recshop.fake/cd#">

<rdf:Description
rdf:about="http://www.recshop.fake/cd/Empire Burlesque">
  <cd:artist>Bob Dylan</cd:artist>
  <cd:country>USA</cd:country>
  <cd:company>Columbia</cd:company>
  <cd:price>10.90</cd:price>
  <cd:year>1985</cd:year>
</rdf:Description>

<rdf:Description
rdf:about="http://www.recshop.fake/cd/Hide your heart">
  <cd:artist>Bonnie Tyler</cd:artist>
  <cd:country>UK</cd:country>
  <cd:company>CBS Records</cd:company>
  <cd:price>9.90</cd:price>
  <cd:year>1988</cd:year>
</rdf:Description>

</rdf:RDF>

It could be that the auto creation of types has a problem; also testing other RDF files it seems types are created as DOCUMENTs but it should be VERTEXes, right?

gramian commented 1 year ago

Likely related to https://github.com/ArcadeData/arcadedb/issues/1144 .