What is the best way to export and import ARC2 RDF data?

I initially did it wrong:

  • I used MySQL to copy tables.

This was bad because ARC2 uses a platform-specific hash function for one of the columns in the table.

So, I think the solution is simple:

// To export $store->createBackup('backup_file.spog'); // To import $store->query('LOAD <file://FULL_PATH_TO_FILE/backup_file.spog>'); 

I wanted to post this question if anyone has more suggestions. I am still new to RDF and ARC2.

Additional information about the ARC2 problem:

  • To search for the URI of an object in a MySQL database, ARC2 uses http://php.net/crc32 hashing. The resulting integer is not 32 bits. Although crc32 () prepares the checksum using the "input string at 32-bit length at a time", the final integer value is platform dependent, which can be seen in the constants PHP_INT_SIZE and PHP_INT_MAX
+4
source share
2 answers

There were no answers to this question (except for the answer proposed by me in my question), therefore I am going to answer my question. The only option I have found so far ... apparently, there are no other ways to make full import / export dumps in ARC2, except ...

 // To export $store->createBackup('backup_file.spog'); // To import $store->query('LOAD <file://FULL_PATH_TO_FILE/backup_file.spog>'); 
+3
source

Yes, backing up SPOG seems to be the easiest option. However, one day I had problems, and instead I used the rdf export:

 $ser = ARC2::getRDFXMLSerializer(); $all = $store->query("SELECT ?s ?p ?o WHERE { ?s ?p ?o }"); $rdfxml2 = $ser->getSerializedTriples($all['result']['rows']); file_put_contents('storename.rdf', $rdfxml2); 
+2
source

Source: https://habr.com/ru/post/1396066/


All Articles