Mercurial > hg > classical
changeset 52:e0e12bd2978d
Build fixes
author | Chris Cannam |
---|---|
date | Thu, 16 Oct 2014 18:53:13 +0100 |
parents | c83cc68483ea |
children | bcea875d8d2f |
files | common/FeatureFileIndex.cpp common/Objects.cpp common/TypeRegistrar.cpp common/common.pro utilities/track/track.cpp utilities/track/track.pro widgets/widgets.pro |
diffstat | 7 files changed, 40 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/common/FeatureFileIndex.cpp Wed Jun 08 15:17:53 2011 +0100 +++ b/common/FeatureFileIndex.cpp Thu Oct 16 18:53:13 2014 +0100 @@ -33,6 +33,8 @@ } m_bs = new BasicStore; + m_bs->setBaseUri(Uri(QUrl::fromLocalFile(m_indexFileName))); + m_index = new TransactionalStore(m_bs); TypeRegistrar::addMappings(m_bs, 0); @@ -104,7 +106,7 @@ // and again with anything else having the same hash if (tf->hash() != "") { - Triple pattern(Node(), "foaf:sha1", Node(Node::Literal, tf->hash())); + Triple pattern(Node(), store->expand("foaf:sha1"), Node(tf->hash())); Triples results = m_index->match(pattern); std::cerr << "FeatureFileIndex::loadFor: " << results.size() << " audio file(s) found with hash " << tf->hash().toStdString() << std::endl; foreach (Triple t, results) { @@ -127,7 +129,7 @@ // hash is present in the feature file but does not match, then it // cannot be the right track even if the URI matches. - Triple pattern(Node(), "foaf:primaryTopic", afuri); + Triple pattern(Node(), store->expand("foaf:primaryTopic"), afuri); Triples results = m_index->match(pattern); std::cerr << "FeatureFileIndex::loadFor: " << results.size() << " feature file(s) for audio file " << afuri << std::endl; @@ -137,7 +139,7 @@ try { BasicStore *b = BasicStore::load(QUrl(t.a.value)); Triples ts = b->match - (Triple(afuri, "a", m_index->expand("mo:AudioFile"))); + (Triple(afuri, store->expand("a"), m_index->expand("mo:AudioFile"))); std::cerr << "FeatureFileIndex::loadFor: feature file " << t.a << " has " << ts.size() << " type node(s) for this audio file" << std::endl; bool someGood = false; @@ -177,8 +179,8 @@ // associating these facts with our own URI for this // file, even if they originated from a different URI // with the same hash) - Node from = Node(Node::URI, afuri.toString()); - Node to = Node(Node::URI, canonicalUri.toString()); + Node from = Node(Uri(afuri.toString())); + Node to = Node(Uri(canonicalUri.toString())); foreach (Triple t, all) { if (t.a == from) t.a = to; if (t.c == from) t.c = to; @@ -235,7 +237,7 @@ void FeatureFileIndex::index(QUrl fileUrl) { - Triple typeTriple(Uri(fileUrl), "a", m_index->expand("foaf:Document")); + Triple typeTriple(Uri(fileUrl), m_index->expand("a"), m_index->expand("foaf:Document")); if (m_index->contains(typeTriple)) { return; @@ -247,9 +249,9 @@ try { BasicStore *b = BasicStore::load(fileUrl); Triples ts = b->match - (Triple(Node(), "a", m_index->expand("mo:AudioFile"))); + (Triple(Node(), m_index->expand("a"), m_index->expand("mo:AudioFile"))); foreach (Triple t, ts) { - tx->add(Triple(Uri(fileUrl), "foaf:primaryTopic", t.a));; + tx->add(Triple(Uri(fileUrl), m_index->expand("foaf:primaryTopic"), t.a));; Triples hashts = b->match (Triple(t.a, m_index->expand("foaf:sha1"), Node())); foreach (Triple hasht, hashts) {
--- a/common/Objects.cpp Wed Jun 08 15:17:53 2011 +0100 +++ b/common/Objects.cpp Thu Oct 16 18:53:13 2014 +0100 @@ -2,7 +2,7 @@ #include "Objects.h" -#include <dataquay/Debug.h> +//#include <dataquay/Debug.h> #include <cstdlib> #include <iostream> @@ -274,11 +274,11 @@ } } if (surnameMatch != "") { - DEBUG << "namesFuzzyMatch: note: surnameMatch = " << surnameMatch << endl; +// DEBUG << "namesFuzzyMatch: note: surnameMatch = " << surnameMatch << endl; if (matchCount > 1) { return true; } else { - DEBUG << "(but not enough else matched)" << endl; +// DEBUG << "(but not enough else matched)" << endl; return false; } } @@ -838,7 +838,7 @@ f.open(QIODevice::ReadOnly); //!!! stream this! QByteArray ba = f.readAll(); - m_hash = QString::fromAscii + m_hash = QString::fromLatin1 (QCryptographicHash::hash(ba, QCryptographicHash::Sha1).toHex()); } QString location = source.getLocation();
--- a/common/TypeRegistrar.cpp Wed Jun 08 15:17:53 2011 +0100 +++ b/common/TypeRegistrar.cpp Thu Oct 16 18:53:13 2014 +0100 @@ -152,14 +152,14 @@ store->addPrefix("property", mapping->getPropertyPrefix()); store->addPrefix("rel", mapping->getRelationshipPrefix()); - store->add(Triple("classical:Composer", "a", store->expand("owl:Class"))); - store->add(Triple("classical:Composer", "rdfs:subClassOf", store->expand("mo:MusicArtist"))); + store->add(Triple(store->expand("classical:Composer"), store->expand("a"), store->expand("owl:Class"))); + store->add(Triple(store->expand("classical:Composer"), store->expand("rdfs:subClassOf"), store->expand("mo:MusicArtist"))); - store->add(Triple("property:birth", "a", store->expand("owl:ObjectProperty"))); - store->add(Triple("property:birth", "rdfs:subPropertyOf", store->expand("bio:event"))); + store->add(Triple(store->expand("property:birth"), store->expand("a"), store->expand("owl:ObjectProperty"))); + store->add(Triple(store->expand("property:birth"), store->expand("rdfs:subPropertyOf"), store->expand("bio:event"))); - store->add(Triple("property:death", "a", store->expand("owl:ObjectProperty"))); - store->add(Triple("property:death", "rdfs:subPropertyOf", store->expand("bio:event"))); + store->add(Triple(store->expand("property:death"), store->expand("a"), store->expand("owl:ObjectProperty"))); + store->add(Triple(store->expand("property:death"), store->expand("rdfs:subPropertyOf"), store->expand("bio:event"))); mapping->addTypeMapping("ClassicalData::Composer", store->expand("classical:Composer")); mapping->addPropertyMapping("ClassicalData::Composer", "pages", store->expand("foaf:page"));
--- a/common/common.pro Wed Jun 08 15:17:53 2011 +0100 +++ b/common/common.pro Thu Oct 16 18:53:13 2014 +0100 @@ -1,11 +1,16 @@ TEMPLATE = lib -TARGET = +TARGET = common -CONFIG += staticlib +QT += network + +CONFIG += staticlib debug HEADERS += EditDistance.h Objects.h Matcher.h TypeRegistrar.h FeatureFileIndex.h SOURCES += EditDistance.cpp Objects.cpp Matcher.cpp TypeRegistrar.cpp FeatureFileIndex.cpp +INCLUDEPATH += ../../dataquay +INCLUDEPATH += ../../sonic-visualiser/svcore + exists(./platform.pri) { include(./platform.pri) }
--- a/utilities/track/track.cpp Wed Jun 08 15:17:53 2011 +0100 +++ b/utilities/track/track.cpp Thu Oct 16 18:53:13 2014 +0100 @@ -10,7 +10,6 @@ #include <dataquay/objectmapper/ObjectStorer.h> #include <dataquay/objectmapper/ObjectMapper.h> #include <dataquay/objectmapper/TypeMapping.h> -#include <dataquay/Debug.h> #include "data/fileio/AudioFileReaderFactory.h" #include "data/fileio/AudioFileReader.h" @@ -31,6 +30,7 @@ using namespace Vamp; using namespace Vamp::HostExt; +/* ostream &operator<<(ostream &target, const QString &str) { return target << str.toLocal8Bit().data(); @@ -40,7 +40,7 @@ { return target << "<" << u.toString() << ">"; } - +*/ bool load(BasicStore *store, QString fileName) @@ -706,6 +706,7 @@ } BasicStore localStore; + localStore.setBaseUri(store->getBaseUri()); TypeRegistrar::addMappings(&localStore, &tm); ObjectStorer *localStorer = new ObjectStorer(&localStore);
--- a/utilities/track/track.pro Wed Jun 08 15:17:53 2011 +0100 +++ b/utilities/track/track.pro Thu Oct 16 18:53:13 2014 +0100 @@ -2,13 +2,16 @@ TARGET = track #QT -= gui network xml -load(../../../all.prf) +QT += network + +CONFIG += debug SOURCES += track.cpp PRE_TARGETDEPS += ../../common/libcommon.a -INCLUDEPATH += ../../common ../../../svcore +INCLUDEPATH += ../../common ../../../dataquay ../../../sonic-visualiser/svcore -LIBS += ../../common/libcommon.a -L../../../svcore -lsvcore ../../../../dataquay/libdataquay.a +LIBS += ../../common/libcommon.a -L../../../sonic-visualiser/svcore -lsvcore ../../../dataquay/libdataquay.a -lsndfile -lsamplerate -lid3tag -lmad -I/usr/include/sord-0 -I/usr/include/serd-0 -lsord-0 -lserd-0 -lvamp-hostsdk +
--- a/widgets/widgets.pro Wed Jun 08 15:17:53 2011 +0100 +++ b/widgets/widgets.pro Thu Oct 16 18:53:13 2014 +0100 @@ -1,14 +1,14 @@ TEMPLATE = lib -TARGET = +TARGET = widgets -load(../../all.prf) +QT += gui widgets network CONFIG += staticlib INCLUDEPATH += ../common -DEPENDPATH += ../../svcore -INCLUDEPATH += ../../svcore +DEPENDPATH += ../../dataquay ../../sonic-visualiser/svcore +INCLUDEPATH += ../../dataquay ../../sonic-visualiser/svcore HEADERS += TypingSelectWidget.h SOURCES += TypingSelectWidget.cpp