oparl / liboparl Goto Github PK
View Code? Open in Web Editor NEWGLib-based library for OParl client applications
License: GNU Lesser General Public License v3.0
GLib-based library for OParl client applications
License: GNU Lesser General Public License v3.0
parsing errors should always contain the id of the concerned object.
liboparl should use object based caching as opposed to request based caching so that objects that have already been retrieved through a list do not need to be loaded again when requested individually.
(I'm aware that a user could already implement that in the resolve
function. But they'd need to parse the object themselves which would self-defeating for a liboparl user)
Currently, the start date and end date of a membership are returned as datetimes instead of dates.
liboparl should support updating the cache. This is likely blocked by #22.
There have been multiple important changes since 0.2.1, most importantly c336466. This means that returning status codes from python requires using master, which is undesirable.
A 0.3.0 release would also allow using the latest improvements in the validator.
currently waiting for the four issues referenced in. mesonbuild/meson#890
when they are done, refine meson.build to make use of the new features
Due to the big number of network requests that has to be made and the unavoidable waiting times it gives important performance improvements to parallelize API request. Therefore I'ld like to know if or how the library can be used with multi-threading. The answer should be added to the documentation.
[2/21] Compiling C object 'oparl-0.2@sha/meson-generated_src_pageable_sequence.c.o'.
FAILED: oparl-0.2@sha/meson-generated_src_pageable_sequence.c.o
cc -Ioparl-0.2@sha -I. -I.. -I/usr/local/include/glib-2.0 -I/usr/local/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/json-glib-1.0 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -w -O0 -g -fPIC '-DGETTEXT_PACKAGE="liboparl"' -MMD -MQ 'oparl-0.2@sha/meson-generated_src_pageable_sequence.c.o' -MF 'oparl-0.2@sha/meson-generated_src_pageable_sequence.c.o.d' -o 'oparl-0.2@sha/meson-generated_src_pageable_sequence.c.o' -c 'oparl-0.2@sha/src/pageable_sequence.c'
/home/grindhold/git/liboparl/src/pageable_sequence.vala: In function ‘t_destroy_func0’:
/home/grindhold/git/liboparl/src/pageable_sequence.vala:130:21: error: ‘t_destroy_func’ undeclared (first use in this function); did you mean ‘t_destroy_func0’?
this.objects = new List();
^~~~~~~~~~~~~~
t_destroy_func0
/home/grindhold/git/liboparl/src/pageable_sequence.vala:130:21: note: each undeclared identifier is reported only once for each function it appears in
[7/21] Compiling C object 'oparl_test@exe/meson-generated_test_legislative_term.c.o'.
ninja: build stopped: subcommand failed.
graupner@felicity:build> meson
The Meson build system
Version: 0.39.1
Source dir: /Users/sgraupner/Development/OParl/liboparl
Build dir: /Users/sgraupner/Development/OParl/liboparl/build
Build type: native build
Project name: oparl
Native vala compiler: valac (valac 0.36.1)
Native c compiler: cc (clang 8.1.0)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/local/bin/pkg-config (0.29.2)
Native dependency glib-2.0 found: YES 2.52.0
Native dependency gobject-2.0 found: YES 2.52.0
Native dependency json-glib-1.0 found: YES 1.2.8
Native dependency gio-2.0 found: YES 2.52.0
Program g-ir-compiler found: YES (/usr/local/bin/g-ir-compiler)
Program valadoc found: YES (/usr/local/bin/valadoc)
Build targets in project: 4
sgraupner@felicity:build> ninja
[1/36] 'Generating apidocs with a custom command.'
FAILED: devhelp
'/usr/local/bin/valadoc' '-o' 'devhelp/oparl-0.2' '--doclet' 'devhelp' '../src/oparl.vala' '../src/body.vala' '../src/person.vala' '../src/membership.vala' '../src/meeting.vala' '../src/system.vala' '../src/object.vala' '../src/organization.vala' '../src/agenda_item.vala' '../src/paper.vala' '../src/consultation.vala' '../src/legislative_term.vala' '../src/location.vala' '../src/file.vala' '--pkg' 'json-glib-1.0' '--force'
error: failed to load driver
Failed: 1 error(s), 0 warning(s)
[2/36] Compiling Vala source ../src/oparl.vala ../src/body.vala ../src/person.vala ...nsultation.vala ../src/legislative_term.vala ../src/location.vala ../src/file.vala.
FAILED: oparl-0.2@sha/oparl.c oparl-0.2@sha/body.c oparl-0.2@sha/person.c oparl-0.2@sha/membership.c oparl-0.2@sha/meeting.c oparl-0.2@sha/system.c oparl-0.2@sha/object.c oparl-0.2@sha/organization.c oparl-0.2@sha/agenda_item.c oparl-0.2@sha/paper.c oparl-0.2@sha/consultation.c oparl-0.2@sha/legislative_term.c oparl-0.2@sha/location.c oparl-0.2@sha/file.c oparl-0.2.h oparl-0.2.vapi
valac '--debug' '-d' 'oparl-0.2@sha' '-C' '--library=oparl-0.2' '-H' 'oparl-0.2.h' '--vapi' '../oparl-0.2.vapi' '--pkg' 'glib-2.0' '--pkg' 'gobject-2.0' '--pkg' 'gio-2.0' '--pkg' 'json-glib-1.0' '--gir=../OParl-0.2.gir' ../src/oparl.vala ../src/body.vala ../src/person.vala ../src/membership.vala ../src/meeting.vala ../src/system.vala ../src/object.vala ../src/organization.vala ../src/agenda_item.vala ../src/paper.vala ../src/consultation.vala ../src/legislative_term.vala ../src/location.vala ../src/file.vala
../src/object.vala:135.43-140.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/object.vala:356.48-362.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/object.vala:365.48-371.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
1 LibOParl compilation failed on macOS with valac 0.36.1
../src/agenda_item.vala:229.48-234.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/file.vala:270.48-275.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/file.vala:278.48-284.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/meeting.vala:285.48-290.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/membership.vala:187.48-192.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/organization.vala:272.48-277.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/legislative_term.vala:104.48-109.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:395.48-401.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:404.48-409.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:412.48-418.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:421.48-426.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:429.48-435.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:438.48-443.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:446.48-452.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:455.48-460.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:463.48-469.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:472.48-477.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/body.vala:480.48-485.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/system.vala:175.48-180.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/system.vala:184.48-189.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/system.vala:192.48-197.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/system.vala:200.48-205.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/object.vala:374.48-381.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/object.vala:388.52-393.21: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/object.vala:396.52-403.21: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/object.vala:407.48-413.17: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/object.vala:424.52-431.21: error: Access to non-public constructor `OParl.ValidationResult.new' denied
../src/object.vala:434.52-441.21: error: Access to non-public constructor `OParl.ValidationResult.new' denied
Compilation failed: 31 error(s), 0 warning(s)
ninja: build stopped: subcommand failed.
1 sgraupner@felicity:build> valac --version
Vala 0.36.1
in some cases, objects get loaded as embedded in other objects. in this case some information is missing. we should provide a OParl.Object.complete
-method to explicitly load the object with all backreferences e.t.c
In the same style we should provide a OParl.Object.is_complete
-property.
Heyho,
it'd be nice when you provide a link to the OParl specification in the README.
cya
Expose an interface that allows the user to implement their own caches for the downloaded OParl objects.
We should probably address these.
The Meson build system
Version: 0.43.0
Source dir: .../liboparl
Build dir: .../liboparl/build
Build type: native build
WARNING: Keyword argument "subdirs" defined multiple times. This will be a an error in future Meson releases.
Project name: oparl
Native C compiler: cc (clang 9.0.0)
Native Vala compiler: valac (valac 0.38.2)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/local/bin/pkg-config (0.29.2)
Native dependency glib-2.0 found: YES 2.54.1
Native dependency gobject-2.0 found: YES 2.54.1
Native dependency json-glib-1.0 found: YES 1.2.8
Native dependency gio-2.0 found: YES 2.54.1
WARNING: Passed invalid keyword argument "langs" in po/meson.build line 23.
This will become a hard error in the future.
Program g-ir-compiler found: YES (/usr/local/bin/g-ir-compiler)
Program valadoc found: YES (/usr/local/bin/valadoc)
WARNING: Passed invalid keyword argument "install" in meson.build line 129.
This will become a hard error in the future.
Build targets in project: 7
Found ninja-1.8.2 at /usr/local/bin/ninja
Currently GeoJSON fields are returned in their native
glib-json representation which can be difficult to use
for programmers accessing liboparl via gobject-introspection
in e.g. python.
We should do some research on wether it would be better
to return the full GeoJSON string and let the user deal
with it however they wish.
Currently GLib doesn't have a way to create a DateTime object exactly representing a iso8601 timestamp. Instead, the parsed timestamp is converted to utc. The conversion itself is valid, but the original timezone is lost.
There is an implementation of the required functionality in gstreamer, implemented here, yet their datetime struct diverges from the GLib one. Instead of fixing the glib it is also be possible to implement the missing functionality in liboparl.
When an object of an internal url list (e.g. organization in consultation) is not available, null / None is silently returned. This is very confusing. Additionally it contradicts the typing (List<Organization>
) and hides an error.
When requesting an invalid body list (unresolved, invalid json, etc. pp.),
liboparl segfaults.
Corresponding validator stack trace:
0 libjson-glib-1.0.0.dylib 0x0000000103e3776c json_node_get_node_type + 4
1 liboparl-0.2.dylib 0x0000000103db0d93 oparl_resolver_parse + 803 (oparl.vala:302)
2 liboparl-0.2.dylib 0x0000000103db08dc oparl_resolver_resolve + 1276 (oparl.vala:222)
3 liboparl-0.2.dylib 0x0000000103dcc5ff oparl_system_get_body + 383 (system.vala:85)
4 liboparl-0.2.dylib 0x0000000103dcd2d9 oparl_system_get_neighbors + 137 (system.vala:194)
When - for some reason - a location has no backreferences
and not own license field, validating a location object
results in a segmentation fault.
Corresponding stack trace from the validator:
0 liboparl-0.2.dylib 0x000000011102a40b oparl_object_refresh + 1099 (object.vala:481)
1 liboparl-0.2.dylib 0x000000011102bda7 oparl_embedded_object_autoload + 119 (object.vala:527)
2 liboparl-0.2.dylib 0x0000000111049ebb oparl_location_get_bodies + 347 (location.vala:73)
3 liboparl-0.2.dylib 0x000000011104df72 oparl_location_real_root_body + 82 (location.vala:146)
4 liboparl-0.2.dylib 0x0000000111029f41 oparl_object_root_body + 97 (object.vala:451)
5 liboparl-0.2.dylib 0x000000011102dc1b oparl_object_real_validate + 2779 (object.vala:418)
6 liboparl-0.2.dylib 0x0000000111029ec9 oparl_object_validate + 89 (object.vala:353)
liboparl's primary use is to build clients. But it is also thinkable to use liboparl's validation functions to validate objects before they leave an oparl-server. Thus it would be necessary to let the users set all attributes. making them private/internal would end up in a even cleaner API. What does the OParl team say?
It's quite common not to have a consultation for an agenda item
After running ninja, i got the following output:
[15/35] Compiling Vala source ../test/main.vala ../test/fixtures.vala ../test/object.vala ../test/system.vala ../...ting.vala ../test/agenda_item.vala ../test/paper.vala ../test/consultation.vala ../test/file.vala oparl-0.2.vapi. FAILED: oparl_test@exe/main.c oparl_test@exe/fixtures.c oparl_test@exe/object.c oparl_test@exe/system.c oparl_test@exe/body.c oparl_test@exe/legislative_term.c oparl_test@exe/location.c oparl_test@exe/organization.c oparl_test@exe/person.c oparl_test@exe/membership.c oparl_test@exe/meeting.c oparl_test@exe/agenda_item.c oparl_test@exe/paper.c oparl_test@exe/consultation.c oparl_test@exe/file.c valac '--debug' '-d' 'oparl_test@exe' '-C' '--pkg' 'glib-2.0' '--pkg' 'gobject-2.0' '--pkg' 'json-glib-1.0' '--pkg' 'gio-2.0' ../test/main.vala ../test/fixtures.vala ../test/object.vala ../test/system.vala ../test/body.vala ../test/legislative_term.vala ../test/location.vala ../test/organization.vala ../test/person.vala ../test/membership.vala ../test/meeting.vala ../test/agenda_item.vala ../test/paper.vala ../test/consultation.vala ../test/file.vala oparl-0.2.vapi ../test/main.vala:28.13-28.40: error: The name
set_nonfatal_assertions' does not exist in the context of GLib.Test' Test.set_nonfatal_assertions(); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ../test/agenda_item.vala:82.17-82.25: error: The name
skip' does not exist in the context of GLib.Test' Test.skip("Due to fixture conflict with file_sane fixture"); ^^^^^^^^^ Compilation failed: 2 error(s), 0 warning(s) [16/35] Compiling c object 'oparl-0.2@sha/oparl-0.2@sha_file.c.o' ninja: build stopped: subcommand failed.
meson output
The Meson build system Version: 0.38.1 Source dir: /xxx/libs/liboparl Build dir: /xxx/libs/liboparl/build Build type: native build Project name: oparl Native vala compiler: valac (valac 0.22.1) Native c compiler: cc (gcc 4.8.4) Build machine cpu family: x86_64 Build machine cpu: x86_64 Found pkg-config: /usr/bin/pkg-config (0.26) Native dependency glib-2.0 found: YES 2.40.2 Native dependency gobject-2.0 found: YES 2.40.2 Native dependency json-glib-1.0 found: YES 0.16.2 Native dependency gio-2.0 found: YES 2.40.2 Program g-ir-compiler found: YES (/usr/bin/g-ir-compiler) Program valadoc found: YES (/usr/bin/valadoc) Build targets in project: 4
meson 0.38.1
ninja 1.7.2
Vala 0.22.1
All OParl entities allow the use of vendor attributes in the form <vendor>:<attributeName>
. Please make sure that these can be processed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.