diff options
author | David Robillard <d@drobilla.net> | 2012-04-06 19:48:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-06 19:48:49 +0000 |
commit | 11ac7470a030647b0efc0cb9836b11c6dbd2467a (patch) | |
tree | 0c5cce427559c2194e181a3f3d7605ef68c3870e | |
parent | ff3c6fc88657d2e94847ceb00adea7597894d897 (diff) | |
download | sord-11ac7470a030647b0efc0cb9836b11c6dbd2467a.tar.gz sord-11ac7470a030647b0efc0cb9836b11c6dbd2467a.tar.bz2 sord-11ac7470a030647b0efc0cb9836b11c6dbd2467a.zip |
Fix compilation as C++.
git-svn-id: http://svn.drobilla.net/sord/trunk@212 3d64ff67-21c5-427c-a301-fe4f08042e5a
-rw-r--r-- | src/sord_validate.c | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/src/sord_validate.c b/src/sord_validate.c index 3dcd86e..2712d12 100644 --- a/src/sord_validate.c +++ b/src/sord_validate.c @@ -117,20 +117,20 @@ error(const char* msg, const SordQuad quad) bool is_subclass_of(SordModel* model, const URIs* uris, - const SordNode* class, + const SordNode* klass, const SordNode* super) { - if (!class) { + if (!klass) { return false; - } else if (sord_node_equals(class, super) || - sord_ask(model, class, uris->owl_equivalentClass, super, NULL)) { + } else if (sord_node_equals(klass, super) || + sord_ask(model, klass, uris->owl_equivalentClass, super, NULL)) { return true; } - SordIter* i = sord_search(model, class, uris->rdfs_subClassOf, NULL, NULL); + SordIter* i = sord_search(model, klass, uris->rdfs_subClassOf, NULL, NULL); for (; !sord_iter_end(i); sord_iter_next(i)) { const SordNode* o = sord_iter_get_node(i, SORD_OBJECT); - if (sord_node_equals(class, o)) { + if (sord_node_equals(klass, o)) { continue; // Class is explicitly subClassOf itself } if (is_subclass_of(model, uris, o, super)) { @@ -272,30 +272,29 @@ main(int argc, char** argv) } #define URI(prefix, suffix) \ - .prefix##_##suffix = sord_new_uri(world, NS_##prefix #suffix) - - URIs uris = { - URI(foaf, Document), - URI(owl, AnnotationProperty), - URI(owl, Class), - URI(owl, DatatypeProperty), - URI(owl, FunctionalProperty), - URI(owl, InverseFunctionalProperty), - URI(owl, ObjectProperty), - URI(owl, OntologyProperty), - URI(owl, Thing), - URI(owl, equivalentClass), - URI(rdf, Property), - URI(rdf, type), - URI(rdfs, Class), - URI(rdfs, Literal), - URI(rdfs, Resource), - URI(rdfs, domain), - URI(rdfs, range), - URI(rdfs, subClassOf), - URI(xsd, pattern), - URI(xsd, string) - }; + uris.prefix##_##suffix = sord_new_uri(world, NS_##prefix #suffix) + + URIs uris; + URI(foaf, Document); + URI(owl, AnnotationProperty); + URI(owl, Class); + URI(owl, DatatypeProperty); + URI(owl, FunctionalProperty); + URI(owl, InverseFunctionalProperty); + URI(owl, ObjectProperty); + URI(owl, OntologyProperty); + URI(owl, Thing); + URI(owl, equivalentClass); + URI(rdf, Property); + URI(rdf, type); + URI(rdfs, Class); + URI(rdfs, Literal); + URI(rdfs, Resource); + URI(rdfs, domain); + URI(rdfs, range); + URI(rdfs, subClassOf); + URI(xsd, pattern); + URI(xsd, string); #ifndef HAVE_PCRE fprintf(stderr, "warning: Built without PCRE, datatypes not checked.\n"); |