Mercurial > hg > svcore
comparison rdf/RDFImporter.cpp @ 727:211efc770335 dataquay
Tiny bit of work on the RDFTransformFactory
| author | Chris Cannam | 
|---|---|
| date | Fri, 18 May 2012 21:23:12 +0100 | 
| parents | 1bfb40549003 | 
| children | 27c861cce97b | 
   comparison
  equal
  deleted
  inserted
  replaced
| 726:1bfb40549003 | 727:211efc770335 | 
|---|---|
| 2 | 2 | 
| 3 /* | 3 /* | 
| 4 Sonic Visualiser | 4 Sonic Visualiser | 
| 5 An audio file viewer and annotation editor. | 5 An audio file viewer and annotation editor. | 
| 6 Centre for Digital Music, Queen Mary, University of London. | 6 Centre for Digital Music, Queen Mary, University of London. | 
| 7 This file copyright 2008 QMUL. | 7 This file copyright 2008-2012 QMUL. | 
| 8 | 8 | 
| 9 This program is free software; you can redistribute it and/or | 9 This program is free software; you can redistribute it and/or | 
| 10 modify it under the terms of the GNU General Public License as | 10 modify it under the terms of the GNU General Public License as | 
| 11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the | 
| 12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file | 
| 137 m_store->addPrefix("af", Uri("http://purl.org/ontology/af/")); | 137 m_store->addPrefix("af", Uri("http://purl.org/ontology/af/")); | 
| 138 m_store->addPrefix("dc", Uri("http://purl.org/dc/elements/1.1/")); | 138 m_store->addPrefix("dc", Uri("http://purl.org/dc/elements/1.1/")); | 
| 139 m_store->addPrefix("tl", Uri("http://purl.org/NET/c4dm/timeline.owl#")); | 139 m_store->addPrefix("tl", Uri("http://purl.org/NET/c4dm/timeline.owl#")); | 
| 140 m_store->addPrefix("event", Uri("http://purl.org/NET/c4dm/event.owl#")); | 140 m_store->addPrefix("event", Uri("http://purl.org/NET/c4dm/event.owl#")); | 
| 141 m_store->addPrefix("rdfs", Uri("http://www.w3.org/2000/01/rdf-schema#")); | 141 m_store->addPrefix("rdfs", Uri("http://www.w3.org/2000/01/rdf-schema#")); | 
| 142 | |
| 143 //!!! may throw! | |
| 142 m_store->import(QUrl::fromLocalFile(uri), BasicStore::ImportIgnoreDuplicates); | 144 m_store->import(QUrl::fromLocalFile(uri), BasicStore::ImportIgnoreDuplicates); | 
| 143 } | 145 } | 
| 144 | 146 | 
| 145 RDFImporterImpl::~RDFImporterImpl() | 147 RDFImporterImpl::~RDFImporterImpl() | 
| 146 { | 148 { | 
| 800 BasicStore *store = 0; | 802 BasicStore *store = 0; | 
| 801 | 803 | 
| 802 // This is not expected to return anything useful, but if it does | 804 // This is not expected to return anything useful, but if it does | 
| 803 // anything at all then we know we have RDF | 805 // anything at all then we know we have RDF | 
| 804 try { | 806 try { | 
| 805 //!!! non-local document? | 807 //!!! non-local document? + may throw!!! | 
| 806 store = BasicStore::load(QUrl(url)); | 808 store = BasicStore::load(QUrl(url)); | 
| 807 Triple t = store->matchFirst(Triple()); | 809 Triple t = store->matchFirst(Triple()); | 
| 808 if (t != Triple()) haveRDF = true; | 810 if (t != Triple()) haveRDF = true; | 
| 809 } catch (...) { | 811 } catch (...) { | 
| 810 } | 812 } | 
