Browse Source

Update sord to 0.10.4

tags/v0.9.0
falkTX 13 years ago
parent
commit
df444ca4ae
100 changed files with 446 additions and 80 deletions
  1. +1
    -1
      c++/carla-includes/sord
  2. +1
    -1
      c++/carla-lilv/Makefile
  3. +0
    -34
      c++/carla-lilv/sord-0.10.0/doc/sord_validate.1
  4. BIN
      c++/carla-lilv/sord-0.10.0/sord-0.10.0.tar.bz2.sig
  5. BIN
      c++/carla-lilv/sord-0.10.0/waf
  6. +0
    -0
      c++/carla-lilv/sord-0.10.4/AUTHORS
  7. +0
    -0
      c++/carla-lilv/sord-0.10.4/COPYING
  8. +0
    -0
      c++/carla-lilv/sord-0.10.4/INSTALL
  9. +10
    -0
      c++/carla-lilv/sord-0.10.4/NEWS
  10. +0
    -0
      c++/carla-lilv/sord-0.10.4/PACKAGING
  11. +0
    -0
      c++/carla-lilv/sord-0.10.4/README
  12. +187
    -0
      c++/carla-lilv/sord-0.10.4/doc/layout.xml
  13. +1
    -1
      c++/carla-lilv/sord-0.10.4/doc/reference.doxygen.in
  14. +57
    -0
      c++/carla-lilv/sord-0.10.4/doc/sord_validate.1
  15. +1
    -1
      c++/carla-lilv/sord-0.10.4/doc/sordi.1
  16. +0
    -0
      c++/carla-lilv/sord-0.10.4/doc/style.css
  17. BIN
      c++/carla-lilv/sord-0.10.4/sord-0.10.4.tar.bz2.sig
  18. +2
    -2
      c++/carla-lilv/sord-0.10.4/sord.pc.in
  19. +0
    -0
      c++/carla-lilv/sord-0.10.4/sord/sord.h
  20. +0
    -0
      c++/carla-lilv/sord-0.10.4/sord/sordmm.hpp
  21. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/sord.c
  22. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/sord_internal.h
  23. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/sord_test.c
  24. +186
    -40
      c++/carla-lilv/sord-0.10.4/src/sord_validate.c
  25. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/sordi.c
  26. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/sordmm_test.cpp
  27. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/syntax.c
  28. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/zix/common.h
  29. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/zix/digest.c
  30. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/zix/digest.h
  31. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/zix/hash.c
  32. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/zix/hash.h
  33. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/zix/tree.c
  34. +0
    -0
      c++/carla-lilv/sord-0.10.4/src/zix/tree.h
  35. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/README.txt
  36. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/UTF-8.ttl
  37. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/manifest.ttl
  38. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/rdf-schema.out
  39. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/rdf-schema.ttl
  40. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/rdfq-results.out
  41. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/rdfq-results.ttl
  42. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/rdfs-namespace.out
  43. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/rdfs-namespace.ttl
  44. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-00.out
  45. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-00.ttl
  46. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-01.out
  47. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-01.ttl
  48. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-02.out
  49. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-02.ttl
  50. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-03.out
  51. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-03.ttl
  52. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-04.out
  53. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-04.ttl
  54. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-05.out
  55. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-05.ttl
  56. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-06.out
  57. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-06.ttl
  58. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-07.out
  59. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-07.ttl
  60. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-08.out
  61. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-08.ttl
  62. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-09.out
  63. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-09.ttl
  64. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-10.out
  65. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-10.ttl
  66. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-11.out
  67. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-11.ttl
  68. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-12.out
  69. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-12.ttl
  70. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-13.out
  71. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-13.ttl
  72. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-14.out
  73. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-14.ttl
  74. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-15.out
  75. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-15.ttl
  76. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-16.out
  77. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-16.ttl
  78. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-17.out
  79. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-17.ttl
  80. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-18.out
  81. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-18.ttl
  82. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-19.out
  83. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-19.ttl
  84. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-20.out
  85. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-20.ttl
  86. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-21.out
  87. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-21.ttl
  88. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-22.out
  89. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-22.ttl
  90. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-23.out
  91. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-23.ttl
  92. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-24.out
  93. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-24.ttl
  94. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-25.out
  95. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-25.ttl
  96. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-26.out
  97. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-26.ttl
  98. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-27.out
  99. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-27.ttl
  100. +0
    -0
      c++/carla-lilv/sord-0.10.4/tests/test-29.out

+ 1
- 1
c++/carla-includes/sord View File

@@ -1 +1 @@
../carla-lilv/sord-0.10.0/sord
../carla-lilv/sord-0.10.4/sord

+ 1
- 1
c++/carla-lilv/Makefile View File

@@ -8,7 +8,7 @@ CC ?= gcc
AR ?= ar AR ?= ar


SERD_VERSION = 0.18.0 SERD_VERSION = 0.18.0
SORD_VERSION = 0.10.0
SORD_VERSION = 0.10.4
SRATOM_VERSION = 0.4.0 SRATOM_VERSION = 0.4.0
LILV_VERSION = 0.14.4 LILV_VERSION = 0.14.4




+ 0
- 34
c++/carla-lilv/sord-0.10.0/doc/sord_validate.1 View File

@@ -1,34 +0,0 @@
.TH SORD_VALIDATE 1 "21 Mar 2012"

.SH NAME
.B sord_validate \- Validate RDF data

.SH SYNOPSIS
sord_validate [OPTION]... INPUT...

This is a simple validator which checks that all used properties are actually
defined, and that the domain and range of properties is explicitly correct.
Note that an "error" from this program does not necessarily mean data is
invalid, since it is not required to explicitly list types in RDF, however it
is a good idea to do so. If data type definitions are available with an
xsd:pattern property, literals with that datatype will be checked against the
xsd:pattern (a regular expresssion) to ensure they are valid.

This program does not retrieve any data from the web or magical places on the
file system. It only processes files passed directly on the command line.
This means you must pass all used vocabularies to get a useful result.
.SH AUTHOR
sord_validate was written by David Robillard <d@drobilla.net>

.SH COPYRIGHT
Copyright \(co 2012 David Robillard.
.br
License: <http://www.opensource.org/licenses/isc-license>
.br
This is free software; you are free to change and redistribute it.
.br
There is NO WARRANTY, to the extent permitted by law.

.SH "SEE ALSO"
<http://drobilla.net/software/sord>

BIN
c++/carla-lilv/sord-0.10.0/sord-0.10.0.tar.bz2.sig View File


BIN
c++/carla-lilv/sord-0.10.0/waf View File


c++/carla-lilv/sord-0.10.0/AUTHORS → c++/carla-lilv/sord-0.10.4/AUTHORS View File


c++/carla-lilv/sord-0.10.0/COPYING → c++/carla-lilv/sord-0.10.4/COPYING View File


c++/carla-lilv/sord-0.10.0/INSTALL → c++/carla-lilv/sord-0.10.4/INSTALL View File


c++/carla-lilv/sord-0.10.0/NEWS → c++/carla-lilv/sord-0.10.4/NEWS View File

@@ -1,3 +1,13 @@
sord (0.10.4) stable;

* Implement better data type validation in sord_validate conformant with
the XSD and OWL specifications
* Fix memory leaks in sord_validate
* Install sord_validate man page
* Disable timestamps in HTML documentation for reproducible build

-- David Robillard <d@drobilla.net> Sun, 14 Oct 2012 18:23:55 -0400

sord (0.10.0) stable; sord (0.10.0) stable;


* Add error callback to world for custom error reporting * Add error callback to world for custom error reporting

c++/carla-lilv/sord-0.10.0/PACKAGING → c++/carla-lilv/sord-0.10.4/PACKAGING View File


c++/carla-lilv/sord-0.10.0/README → c++/carla-lilv/sord-0.10.4/README View File


+ 187
- 0
c++/carla-lilv/sord-0.10.4/doc/layout.xml View File

@@ -0,0 +1,187 @@
<doxygenlayout version="1.0">
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>

<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<allmemberslink visible="yes"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>

<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>

<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>

<!-- Layout definition for a group page -->
<group>
<briefdescription visible="no"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<detaileddescription title=""/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>

<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

c++/carla-lilv/sord-0.10.0/doc/reference.doxygen.in → c++/carla-lilv/sord-0.10.4/doc/reference.doxygen.in View File

@@ -939,7 +939,7 @@ HTML_COLORSTYLE_GAMMA = 80
# page will contain the date and time when the page was generated. Setting # page will contain the date and time when the page was generated. Setting
# this to NO can help when comparing the output of multiple runs. # this to NO can help when comparing the output of multiple runs.


HTML_TIMESTAMP = YES
HTML_TIMESTAMP = NO


# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the # documentation will contain sections that can be hidden and shown after the

+ 57
- 0
c++/carla-lilv/sord-0.10.4/doc/sord_validate.1 View File

@@ -0,0 +1,57 @@
.TH SORD_VALIDATE 1 "21 Mar 2012"

.SH NAME
.B sord_validate \- Validate RDF data

.SH SYNOPSIS
sord_validate [OPTION]... INPUT...

.SH OPTIONS
.TP
\fB\-h\fR
Print the command line options.

.TP
\fB\-l\fR
Print errors on a single line.

.TP
\fB\-v\fR
Display version information and exit.

.SH DESCRIPTION
This is a simple validator which checks that all used properties are actually
defined, and that the domain and range of properties is explicitly correct.
Note that an "error" from this program does not necessarily mean data is
invalid, since it is not required to explicitly list types in RDF, however it
is a good idea to do so.

This program never retrieves data from the web or magical places on the file
system, it only processes files passed directly on the command line. This
means you must pass all used vocabularies to get a useful result.

If an appropriate schema is available, literals are checked against datatype
definitions (both the explicit datatype of the literal itself as well as any
types implied by the corresponding property). Three XML Schema Datatypes (XSD)
constraints are currently supported: regular expressions (xsd:pattern), and
inclusive range (xsd:minimumInclusive and xsd:maximumInclusive). Given an
appropriate schema, this is enough to validate against most of the standard XSD
datatypes.

.SH EXAMPLES
sord_validate `find ~/schemas/ -name '*.ttl'` data.ttl

.SH AUTHOR
sord_validate was written by David Robillard <d@drobilla.net>

.SH COPYRIGHT
Copyright \(co 2012 David Robillard.
.br
License: <http://www.opensource.org/licenses/isc-license>
.br
This is free software; you are free to change and redistribute it.
.br
There is NO WARRANTY, to the extent permitted by law.

.SH "SEE ALSO"
<http://drobilla.net/software/sord>

c++/carla-lilv/sord-0.10.0/doc/sordi.1 → c++/carla-lilv/sord-0.10.4/doc/sordi.1 View File

@@ -8,7 +8,7 @@ sordi [OPTION]... INPUT BASE_URI


.SH OPTIONS .SH OPTIONS
.TP .TP
\fB\-h\fR, \fB\-\-help\fR
\fB\-h\fR
Print the command line options. Print the command line options.


.TP .TP

c++/carla-lilv/sord-0.10.0/doc/style.css → c++/carla-lilv/sord-0.10.4/doc/style.css View File


BIN
c++/carla-lilv/sord-0.10.4/sord-0.10.4.tar.bz2.sig View File


c++/carla-lilv/sord-0.10.0/sord.pc.in → c++/carla-lilv/sord-0.10.4/sord.pc.in View File

@@ -6,6 +6,6 @@ includedir=@INCLUDEDIR@
Name: Sord Name: Sord
Version: @SORD_VERSION@ Version: @SORD_VERSION@
Description: A lightweight C library for storing RDF statements in memory. Description: A lightweight C library for storing RDF statements in memory.
Requires: serd-0
Libs: -L${libdir} -lsord-@SORD_MAJOR_VERSION@
Requires: @PKG_serd_0@
Libs: -L${libdir} -l@LIB_SORD@
Cflags: -I${includedir}/sord-@SORD_MAJOR_VERSION@ Cflags: -I${includedir}/sord-@SORD_MAJOR_VERSION@

c++/carla-lilv/sord-0.10.0/sord/sord.h → c++/carla-lilv/sord-0.10.4/sord/sord.h View File


c++/carla-lilv/sord-0.10.0/sord/sordmm.hpp → c++/carla-lilv/sord-0.10.4/sord/sordmm.hpp View File


c++/carla-lilv/sord-0.10.0/src/sord.c → c++/carla-lilv/sord-0.10.4/src/sord.c View File


c++/carla-lilv/sord-0.10.0/src/sord_internal.h → c++/carla-lilv/sord-0.10.4/src/sord_internal.h View File


c++/carla-lilv/sord-0.10.0/src/sord_test.c → c++/carla-lilv/sord-0.10.4/src/sord_test.c View File


c++/carla-lilv/sord-0.10.0/src/sord_validate.c → c++/carla-lilv/sord-0.10.4/src/sord_validate.c View File

@@ -51,7 +51,11 @@ typedef struct {
SordNode* owl_OntologyProperty; SordNode* owl_OntologyProperty;
SordNode* owl_Thing; SordNode* owl_Thing;
SordNode* owl_equivalentClass; SordNode* owl_equivalentClass;
SordNode* owl_onDatatype;
SordNode* owl_withRestrictions;
SordNode* rdf_Property; SordNode* rdf_Property;
SordNode* rdf_first;
SordNode* rdf_rest;
SordNode* rdf_type; SordNode* rdf_type;
SordNode* rdfs_Class; SordNode* rdfs_Class;
SordNode* rdfs_Literal; SordNode* rdfs_Literal;
@@ -59,11 +63,15 @@ typedef struct {
SordNode* rdfs_domain; SordNode* rdfs_domain;
SordNode* rdfs_range; SordNode* rdfs_range;
SordNode* rdfs_subClassOf; SordNode* rdfs_subClassOf;
SordNode* xsd_decimal;
SordNode* xsd_maxInclusive;
SordNode* xsd_minInclusive;
SordNode* xsd_pattern; SordNode* xsd_pattern;
SordNode* xsd_string; SordNode* xsd_string;
} URIs; } URIs;


int n_errors = 0; int n_errors = 0;
int n_restrictions = 0;
bool one_line_errors = false; bool one_line_errors = false;


static int static int
@@ -84,7 +92,9 @@ print_usage(const char* name, bool error)
FILE* const os = error ? stderr : stdout; FILE* const os = error ? stderr : stdout;
fprintf(os, "Usage: %s [OPTION]... INPUT...\n", name); fprintf(os, "Usage: %s [OPTION]... INPUT...\n", name);
fprintf(os, "Validate RDF data\n\n"); fprintf(os, "Validate RDF data\n\n");
fprintf(os, " -h Display this help and exit\n");
fprintf(os, " -l Print errors on a single line.\n"); fprintf(os, " -l Print errors on a single line.\n");
fprintf(os, " -v Display version information and exit\n");
fprintf(os, fprintf(os,
"Validate RDF data. This is a simple validator which checks\n" "Validate RDF data. This is a simple validator which checks\n"
"that all used properties are actually defined. It does not do\n" "that all used properties are actually defined. It does not do\n"
@@ -119,25 +129,26 @@ error(const char* msg, const SordQuad quad)
} }


static bool static bool
is_subclass_of(SordModel* model,
const URIs* uris,
const SordNode* klass,
const SordNode* super)
is_descendant_of(SordModel* model,
const URIs* uris,
const SordNode* child,
const SordNode* parent,
const SordNode* pred)
{ {
if (!klass) {
if (!child) {
return false; return false;
} else if (sord_node_equals(klass, super) ||
sord_ask(model, klass, uris->owl_equivalentClass, super, NULL)) {
} else if (sord_node_equals(child, parent) ||
sord_ask(model, child, uris->owl_equivalentClass, parent, NULL)) {
return true; return true;
} }


SordIter* i = sord_search(model, klass, uris->rdfs_subClassOf, NULL, NULL);
SordIter* i = sord_search(model, child, pred, NULL, NULL);
for (; !sord_iter_end(i); sord_iter_next(i)) { for (; !sord_iter_end(i); sord_iter_next(i)) {
const SordNode* o = sord_iter_get_node(i, SORD_OBJECT); const SordNode* o = sord_iter_get_node(i, SORD_OBJECT);
if (sord_node_equals(klass, o)) {
continue; // Class is explicitly subClassOf itself
if (sord_node_equals(child, o)) {
continue; // Weird class is explicitly a descendent of itself
} }
if (is_subclass_of(model, uris, o, super)) {
if (is_descendant_of(model, uris, o, parent, pred)) {
sord_iter_free(i); sord_iter_free(i);
return true; return true;
} }
@@ -148,27 +159,122 @@ is_subclass_of(SordModel* model,
} }


static bool static bool
regexp_match(const char* pat, const char* str)
regexp_match(const uint8_t* pat, const char* str)
{ {
#ifdef HAVE_PCRE #ifdef HAVE_PCRE
// Append a $ to the pattern so we only match if the entire string matches
const size_t len = strlen((const char*)pat);
char* const regx = malloc(len + 2);
memcpy(regx, pat, len);
regx[len] = '$';
regx[len + 1] = '\0';

const char* err; const char* err;
int erroffset; int erroffset;
pcre* re = pcre_compile(pat, PCRE_ANCHORED, &err, &erroffset, NULL);
pcre* re = pcre_compile(regx, PCRE_ANCHORED, &err, &erroffset, NULL);
free(regx);
if (!re) { if (!re) {
fprintf(stderr, "Error in regexp \"%s\" at offset %d (%s)\n",
fprintf(stderr, "Error in pattern `%s' at offset %d (%s)\n",
pat, erroffset, err); pat, erroffset, err);
return false; return false;
} }


int st = pcre_exec(re, NULL, str, strlen(str), 0, 0, NULL, 0);
if (st < 0) {
fprintf(stderr, "Error %d executing regexp \"%s\"\n", st, pat);
return false;
}
const bool ret = pcre_exec(re, NULL, str, strlen(str), 0, 0, NULL, 0) >= 0;
pcre_free(re);
return ret;
#endif // HAVE_PCRE #endif // HAVE_PCRE
return true; return true;
} }


static bool
check_restriction(SordModel* model,
const URIs* uris,
const SordNode* literal,
const SordNode* type,
const SordNode* restriction)
{
size_t len = 0;
const char* str = (const char*)sord_node_get_string_counted(literal, &len);
++n_restrictions;

// Check xsd:pattern
SordIter* p = sord_search(model, restriction, uris->xsd_pattern, 0, 0);
if (p) {
const SordNode* pat = sord_iter_get_node(p, SORD_OBJECT);
const bool good = regexp_match(sord_node_get_string(pat), str);
if (!good) {
fprintf(stderr, "`%s' does not match <%s> pattern `%s'\n",
sord_node_get_string(literal),
sord_node_get_string(type),
sord_node_get_string(pat));
}

sord_iter_free(p);
return good;
}

/* We'll do some comparison tricks for xsd:decimal types, where
lexicographical comparison would be incorrect. Note that if the
literal's type is a descendant of xsd:decimal, we'll end up checking it
against the xsd:decimal pattern so there's no need to validate digits
here. At worst we'll get a false positive but it will fail later. */
const bool is_decimal = is_descendant_of(
model, uris, type, uris->xsd_decimal, uris->owl_onDatatype);

// Check xsd:minInclusive
SordIter* l = sord_search(model, restriction, uris->xsd_minInclusive, 0, 0);
if (l) {
const SordNode* lower = sord_iter_get_node(l, SORD_OBJECT);
size_t lower_len = 0;
const char* lower_str = (const char*)sord_node_get_string_counted(lower, &lower_len);
bool good = false;
if (!is_decimal || len == lower_len) {
// Not decimal, or equal lengths, strcmp
good = (strcmp(str, lower_str) >= 0);
} else {
// Decimal with different length, only good if longer than the min
good = (len > lower_len);
}
if (!good) {
fprintf(stderr, "`%s' is not >= <%s> minimum `%s'\n",
sord_node_get_string(literal),
sord_node_get_string(type),
sord_node_get_string(lower));
}
sord_iter_free(l);
return good;
}

// Check xsd:maxInclusive
SordIter* u = sord_search(model, restriction, uris->xsd_maxInclusive, 0, 0);
if (u) {
const SordNode* upper = sord_iter_get_node(u, SORD_OBJECT);
size_t upper_len = 0;
const char* upper_str = (const char*)sord_node_get_string_counted(upper, &upper_len);
bool good = false;
if (!is_decimal || len == upper_len) {
// Not decimal, or equal lengths, strcmp
good = (strcmp(str, upper_str) <= 0);
} else {
// Decimal with different length, only good if shorter than the max
good = (len < upper_len);
}
if (!good) {
fprintf(stderr, "`%s' is not <= <%s> maximum `%s'\n",
sord_node_get_string(literal),
sord_node_get_string(type),
sord_node_get_string(upper));
}
sord_iter_free(u);
return good;
}

--n_restrictions;
return true; // Unknown restriction, be quietly tolerant
}

static bool static bool
literal_is_valid(SordModel* model, literal_is_valid(SordModel* model,
const URIs* uris, const URIs* uris,
@@ -179,22 +285,47 @@ literal_is_valid(SordModel* model,
return true; return true;
} }


SordIter* p = sord_search(model, type, uris->xsd_pattern, 0, 0);
const SordNode* pattern = sord_iter_get_node(p, SORD_OBJECT);
if (!pattern) {
fprintf(stderr, "warning: No pattern for datatype <%s>\n",
sord_node_get_string(type));
return true;
// Find restrictions list
SordIter* rs = sord_search(model, type, uris->owl_withRestrictions, 0, 0);
if (sord_iter_end(rs)) {
return true; // No restrictions
} }
if (regexp_match((const char*)sord_node_get_string(pattern),
(const char*)sord_node_get_string(literal))) {
return true;

// Walk list, checking each restriction
const SordNode* head = sord_iter_get_node(rs, SORD_OBJECT);
while (head) {
SordIter* f = sord_search(model, head, uris->rdf_first, 0, 0);
if (!f) {
break; // Reached end of restrictions list without failure
}

// Check this restriction
const bool good = check_restriction(
model, uris, literal, type, sord_iter_get_node(f, SORD_OBJECT));
sord_iter_free(f);

if (!good) {
sord_iter_free(rs);
return false; // Failed, literal is invalid
}

// Seek to next list node
SordIter* n = sord_search(model, head, uris->rdf_rest, 0, 0);
head = n ? sord_iter_get_node(n, SORD_OBJECT) : NULL;
sord_iter_free(n);
} }
fprintf(stderr, "Literal \"%s\" does not match <%s> pattern \"%s\"\n",
sord_node_get_string(literal),
sord_node_get_string(type),
sord_node_get_string(pattern));
return false;

sord_iter_free(rs);

SordIter* s = sord_search(model, type, uris->owl_onDatatype, 0, 0);
if (s) {
const SordNode* super = sord_iter_get_node(s, SORD_OBJECT);
const bool good = literal_is_valid(model, uris, literal, super);
sord_iter_free(s);
return good; // Match iff literal also matches supertype
}

return true; // Matches top level type
} }


static bool static bool
@@ -213,9 +344,7 @@ check_type(SordModel* model,
sord_node_equals(type, uris->xsd_string)) { sord_node_equals(type, uris->xsd_string)) {
return true; return true;
} else { } else {
const SordNode* datatype = sord_node_get_datatype(node);
return is_subclass_of(model, uris, datatype, type) ||
literal_is_valid(model, uris, node, type);
return literal_is_valid(model, uris, node, type);
} }
} else if (sord_node_get_type(node) == SORD_URI) { } else if (sord_node_get_type(node) == SORD_URI) {
if (sord_node_equals(type, uris->foaf_Document)) { if (sord_node_equals(type, uris->foaf_Document)) {
@@ -223,9 +352,10 @@ check_type(SordModel* model,
} else { } else {
SordIter* t = sord_search(model, node, uris->rdf_type, NULL, NULL); SordIter* t = sord_search(model, node, uris->rdf_type, NULL, NULL);
for (; !sord_iter_end(t); sord_iter_next(t)) { for (; !sord_iter_end(t); sord_iter_next(t)) {
if (is_subclass_of(model, uris,
sord_iter_get_node(t, SORD_OBJECT),
type)) {
if (is_descendant_of(model, uris,
sord_iter_get_node(t, SORD_OBJECT),
type,
uris->rdfs_subClassOf)) {
sord_iter_free(t); sord_iter_free(t);
return true; return true;
} }
@@ -285,7 +415,10 @@ main(int argc, char** argv)
} }


serd_node_free(&base_uri_node); serd_node_free(&base_uri_node);
free(in_path);
} }
serd_reader_free(reader);
serd_env_free(env);


#define URI(prefix, suffix) \ #define URI(prefix, suffix) \
uris.prefix##_##suffix = sord_new_uri(world, NS_##prefix #suffix) uris.prefix##_##suffix = sord_new_uri(world, NS_##prefix #suffix)
@@ -301,7 +434,11 @@ main(int argc, char** argv)
URI(owl, OntologyProperty); URI(owl, OntologyProperty);
URI(owl, Thing); URI(owl, Thing);
URI(owl, equivalentClass); URI(owl, equivalentClass);
URI(owl, onDatatype);
URI(owl, withRestrictions);
URI(rdf, Property); URI(rdf, Property);
URI(rdf, first);
URI(rdf, rest);
URI(rdf, type); URI(rdf, type);
URI(rdfs, Class); URI(rdfs, Class);
URI(rdfs, Literal); URI(rdfs, Literal);
@@ -309,6 +446,9 @@ main(int argc, char** argv)
URI(rdfs, domain); URI(rdfs, domain);
URI(rdfs, range); URI(rdfs, range);
URI(rdfs, subClassOf); URI(rdfs, subClassOf);
URI(xsd, decimal);
URI(xsd, maxInclusive);
URI(xsd, minInclusive);
URI(xsd, pattern); URI(xsd, pattern);
URI(xsd, string); URI(xsd, string);


@@ -385,6 +525,7 @@ main(int argc, char** argv)
fprintf(stderr, "note: Range is <%s>\n", fprintf(stderr, "note: Range is <%s>\n",
sord_node_get_string(range)); sord_node_get_string(range));
} }
sord_iter_free(r);
} }


SordIter* d = sord_search(model, pred, uris.rdfs_domain, NULL, NULL); SordIter* d = sord_search(model, pred, uris.rdfs_domain, NULL, NULL);
@@ -395,10 +536,15 @@ main(int argc, char** argv)
fprintf(stderr, "note: Domain is <%s>\n", fprintf(stderr, "note: Domain is <%s>\n",
sord_node_get_string(domain)); sord_node_get_string(domain));
} }
sord_iter_free(d);
} }
} }
sord_iter_free(i); sord_iter_free(i);


printf("Found %d errors among %d files\n", n_errors, argc - 1);
printf("Found %d errors among %d files (checked %d restrictions)\n",
n_errors, argc - 1, n_restrictions);

sord_free(model);
sord_world_free(world);
return 0; return 0;
} }

c++/carla-lilv/sord-0.10.0/src/sordi.c → c++/carla-lilv/sord-0.10.4/src/sordi.c View File


c++/carla-lilv/sord-0.10.0/src/sordmm_test.cpp → c++/carla-lilv/sord-0.10.4/src/sordmm_test.cpp View File


c++/carla-lilv/sord-0.10.0/src/syntax.c → c++/carla-lilv/sord-0.10.4/src/syntax.c View File


c++/carla-lilv/sord-0.10.0/src/zix/common.h → c++/carla-lilv/sord-0.10.4/src/zix/common.h View File


c++/carla-lilv/sord-0.10.0/src/zix/digest.c → c++/carla-lilv/sord-0.10.4/src/zix/digest.c View File


c++/carla-lilv/sord-0.10.0/src/zix/digest.h → c++/carla-lilv/sord-0.10.4/src/zix/digest.h View File


c++/carla-lilv/sord-0.10.0/src/zix/hash.c → c++/carla-lilv/sord-0.10.4/src/zix/hash.c View File


c++/carla-lilv/sord-0.10.0/src/zix/hash.h → c++/carla-lilv/sord-0.10.4/src/zix/hash.h View File


c++/carla-lilv/sord-0.10.0/src/zix/tree.c → c++/carla-lilv/sord-0.10.4/src/zix/tree.c View File


c++/carla-lilv/sord-0.10.0/src/zix/tree.h → c++/carla-lilv/sord-0.10.4/src/zix/tree.h View File


c++/carla-lilv/sord-0.10.0/tests/README.txt → c++/carla-lilv/sord-0.10.4/tests/README.txt View File


c++/carla-lilv/sord-0.10.0/tests/UTF-8.ttl → c++/carla-lilv/sord-0.10.4/tests/UTF-8.ttl View File


c++/carla-lilv/sord-0.10.0/tests/manifest.ttl → c++/carla-lilv/sord-0.10.4/tests/manifest.ttl View File


c++/carla-lilv/sord-0.10.0/tests/rdf-schema.out → c++/carla-lilv/sord-0.10.4/tests/rdf-schema.out View File


c++/carla-lilv/sord-0.10.0/tests/rdf-schema.ttl → c++/carla-lilv/sord-0.10.4/tests/rdf-schema.ttl View File


c++/carla-lilv/sord-0.10.0/tests/rdfq-results.out → c++/carla-lilv/sord-0.10.4/tests/rdfq-results.out View File


c++/carla-lilv/sord-0.10.0/tests/rdfq-results.ttl → c++/carla-lilv/sord-0.10.4/tests/rdfq-results.ttl View File


c++/carla-lilv/sord-0.10.0/tests/rdfs-namespace.out → c++/carla-lilv/sord-0.10.4/tests/rdfs-namespace.out View File


c++/carla-lilv/sord-0.10.0/tests/rdfs-namespace.ttl → c++/carla-lilv/sord-0.10.4/tests/rdfs-namespace.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-00.out → c++/carla-lilv/sord-0.10.4/tests/test-00.out View File


c++/carla-lilv/sord-0.10.0/tests/test-00.ttl → c++/carla-lilv/sord-0.10.4/tests/test-00.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-01.out → c++/carla-lilv/sord-0.10.4/tests/test-01.out View File


c++/carla-lilv/sord-0.10.0/tests/test-01.ttl → c++/carla-lilv/sord-0.10.4/tests/test-01.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-02.out → c++/carla-lilv/sord-0.10.4/tests/test-02.out View File


c++/carla-lilv/sord-0.10.0/tests/test-02.ttl → c++/carla-lilv/sord-0.10.4/tests/test-02.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-03.out → c++/carla-lilv/sord-0.10.4/tests/test-03.out View File


c++/carla-lilv/sord-0.10.0/tests/test-03.ttl → c++/carla-lilv/sord-0.10.4/tests/test-03.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-04.out → c++/carla-lilv/sord-0.10.4/tests/test-04.out View File


c++/carla-lilv/sord-0.10.0/tests/test-04.ttl → c++/carla-lilv/sord-0.10.4/tests/test-04.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-05.out → c++/carla-lilv/sord-0.10.4/tests/test-05.out View File


c++/carla-lilv/sord-0.10.0/tests/test-05.ttl → c++/carla-lilv/sord-0.10.4/tests/test-05.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-06.out → c++/carla-lilv/sord-0.10.4/tests/test-06.out View File


c++/carla-lilv/sord-0.10.0/tests/test-06.ttl → c++/carla-lilv/sord-0.10.4/tests/test-06.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-07.out → c++/carla-lilv/sord-0.10.4/tests/test-07.out View File


c++/carla-lilv/sord-0.10.0/tests/test-07.ttl → c++/carla-lilv/sord-0.10.4/tests/test-07.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-08.out → c++/carla-lilv/sord-0.10.4/tests/test-08.out View File


c++/carla-lilv/sord-0.10.0/tests/test-08.ttl → c++/carla-lilv/sord-0.10.4/tests/test-08.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-09.out → c++/carla-lilv/sord-0.10.4/tests/test-09.out View File


c++/carla-lilv/sord-0.10.0/tests/test-09.ttl → c++/carla-lilv/sord-0.10.4/tests/test-09.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-10.out → c++/carla-lilv/sord-0.10.4/tests/test-10.out View File


c++/carla-lilv/sord-0.10.0/tests/test-10.ttl → c++/carla-lilv/sord-0.10.4/tests/test-10.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-11.out → c++/carla-lilv/sord-0.10.4/tests/test-11.out View File


c++/carla-lilv/sord-0.10.0/tests/test-11.ttl → c++/carla-lilv/sord-0.10.4/tests/test-11.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-12.out → c++/carla-lilv/sord-0.10.4/tests/test-12.out View File


c++/carla-lilv/sord-0.10.0/tests/test-12.ttl → c++/carla-lilv/sord-0.10.4/tests/test-12.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-13.out → c++/carla-lilv/sord-0.10.4/tests/test-13.out View File


c++/carla-lilv/sord-0.10.0/tests/test-13.ttl → c++/carla-lilv/sord-0.10.4/tests/test-13.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-14.out → c++/carla-lilv/sord-0.10.4/tests/test-14.out View File


c++/carla-lilv/sord-0.10.0/tests/test-14.ttl → c++/carla-lilv/sord-0.10.4/tests/test-14.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-15.out → c++/carla-lilv/sord-0.10.4/tests/test-15.out View File


c++/carla-lilv/sord-0.10.0/tests/test-15.ttl → c++/carla-lilv/sord-0.10.4/tests/test-15.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-16.out → c++/carla-lilv/sord-0.10.4/tests/test-16.out View File


c++/carla-lilv/sord-0.10.0/tests/test-16.ttl → c++/carla-lilv/sord-0.10.4/tests/test-16.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-17.out → c++/carla-lilv/sord-0.10.4/tests/test-17.out View File


c++/carla-lilv/sord-0.10.0/tests/test-17.ttl → c++/carla-lilv/sord-0.10.4/tests/test-17.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-18.out → c++/carla-lilv/sord-0.10.4/tests/test-18.out View File


c++/carla-lilv/sord-0.10.0/tests/test-18.ttl → c++/carla-lilv/sord-0.10.4/tests/test-18.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-19.out → c++/carla-lilv/sord-0.10.4/tests/test-19.out View File


c++/carla-lilv/sord-0.10.0/tests/test-19.ttl → c++/carla-lilv/sord-0.10.4/tests/test-19.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-20.out → c++/carla-lilv/sord-0.10.4/tests/test-20.out View File


c++/carla-lilv/sord-0.10.0/tests/test-20.ttl → c++/carla-lilv/sord-0.10.4/tests/test-20.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-21.out → c++/carla-lilv/sord-0.10.4/tests/test-21.out View File


c++/carla-lilv/sord-0.10.0/tests/test-21.ttl → c++/carla-lilv/sord-0.10.4/tests/test-21.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-22.out → c++/carla-lilv/sord-0.10.4/tests/test-22.out View File


c++/carla-lilv/sord-0.10.0/tests/test-22.ttl → c++/carla-lilv/sord-0.10.4/tests/test-22.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-23.out → c++/carla-lilv/sord-0.10.4/tests/test-23.out View File


c++/carla-lilv/sord-0.10.0/tests/test-23.ttl → c++/carla-lilv/sord-0.10.4/tests/test-23.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-24.out → c++/carla-lilv/sord-0.10.4/tests/test-24.out View File


c++/carla-lilv/sord-0.10.0/tests/test-24.ttl → c++/carla-lilv/sord-0.10.4/tests/test-24.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-25.out → c++/carla-lilv/sord-0.10.4/tests/test-25.out View File


c++/carla-lilv/sord-0.10.0/tests/test-25.ttl → c++/carla-lilv/sord-0.10.4/tests/test-25.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-26.out → c++/carla-lilv/sord-0.10.4/tests/test-26.out View File


c++/carla-lilv/sord-0.10.0/tests/test-26.ttl → c++/carla-lilv/sord-0.10.4/tests/test-26.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-27.out → c++/carla-lilv/sord-0.10.4/tests/test-27.out View File


c++/carla-lilv/sord-0.10.0/tests/test-27.ttl → c++/carla-lilv/sord-0.10.4/tests/test-27.ttl View File


c++/carla-lilv/sord-0.10.0/tests/test-29.out → c++/carla-lilv/sord-0.10.4/tests/test-29.out View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save