rob-metalinkage / django-rdf-io Goto Github PK
View Code? Open in Web Editor NEWSimple RDF serialiser/deserialiser to support synching a django model with an external triple-store
License: Creative Commons Zero v1.0 Universal
Simple RDF serialiser/deserialiser to support synching a django model with an external triple-store
License: Creative Commons Zero v1.0 Universal
Hi Rob,
When I was looking for ways to synchronize Django models with another database, I found your project. Thank you for offering it open source!
As far as I can tell, it is exactly what I need:
When creating or changing an object, the object should be serialized and written to the database (GraphDB). For serialization, I would like to be able to define a ruleset for my object types.
When deleting an object, the object should be deleted from the graph (e.g. through a context or a named graph).
Is this module suitable for this? Do you plan to maintain the project in the long term?
Thanks and greetings
Julian
using external services for inferencing involves complex operations to either setup and tear down, or cleanup of intermediate states in the inferencing context. A native python inferencing pathway may be preferable.
Should be possible to assist mapping creation by listing available object properties with an autocomplete capability - or some other widget trick on editing mappings.
RDF_IO is designed to serialise other application models as RDF.
django-skosxl is a good place to start - needs updating to python 3 though,
Allow an app such as skosxl to define default mappings (to SKOS!) and have these used by serialiser automatically.
RDF_IO handles the ORM -> graph configuration and RDF utilities like namespace handling and RDF ingest mechanisms.
pushing a Linked Data API to the user using these mapping is currently pushed off to other services - such as RDF4J or Marmotta where scalability and UI can be addressed,
A "native" capability exploiting Django's templating similar to
https://github.com/RDFLib/pyLDAPI
would be useful
or an alternative approach for Linked Data on top of native Django objects (e.g. https://git.happy-dev.fr/startinblox/djangoldp-packages/djangoldp) could be extended to support the mapping and namespace handling RDF_IO provides.
any approach should be extensible to support multiple profiles - see https://www.w3.org/TR/2018/WD-dx-prof-conneg-20181218/
currently dumb free text - should support autocomplete by looking as target model
On the backburner when time permits - but a good project if anyone want to take it on I can support.
Hello Rob,
running your unittests with pytest under python 3.8 with django 3.0.5 results in the exception django.core.exceptions.AppRegistryNotReady
.
You tried to fix this by adjusting the signalling, but the error still remains. Do you have an idea, why ?
Here is the full output of the tests:
`==================================================================================================================== test session starts =====================================================================================================================
platform linux -- Python 3.8.0, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /lair/source/collection/python/django/django-rdf-io
plugins: mock-3.1.0
collected 0 items / 2 errors
=========================================================================================================================== ERRORS ===========================================================================================================================
_______________________________________________________________________________________________________ ERROR collecting rdf_io/tests/test_mappings.py _______________________________________________________________________________________________________
tests/test_mappings.py:1: in
from rdf_io.models import *
models.py:18: in
from django.contrib.contenttypes.fields import GenericForeignKey
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/contrib/contenttypes/fields.py:3: in
from django.contrib.contenttypes.models import ContentType
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/contrib/contenttypes/models.py:134: in
class ContentType(models.Model):
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/db/models/base.py:87: in new
app_config = apps.get_containing_app_config(module)
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/apps/registry.py:249: in get_containing_app_config
self.check_apps_ready()
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/apps/registry.py:132: in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
E django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
_______________________________________________________________________________________________________ ERROR collecting rdf_io/tests/test_viewspy.py ________________________________________________________________________________________________________
tests/test_viewspy.py:1: in
from rdf_io.views import *
views/init.py:1: in
from .serialize import *
views/serialize.py:3: in
from rdf_io.models import *
models.py:18: in
from django.contrib.contenttypes.fields import GenericForeignKey
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/contrib/contenttypes/fields.py:3: in
from django.contrib.contenttypes.models import ContentType
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/contrib/contenttypes/models.py:134: in
class ContentType(models.Model):
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/db/models/base.py:87: in new
app_config = apps.get_containing_app_config(module)
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/apps/registry.py:249: in get_containing_app_config
self.check_apps_ready()
/home/mark/py3venv/lara/lib/python3.8/site-packages/django/apps/registry.py:132: in check_apps_ready
raise AppRegistryNotReady("Apps aren't loaded yet.")
E django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
================================================================================================================== short test summary info ===================================================================================================================
ERROR tests/test_mappings.py - django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
ERROR tests/test_viewspy.py - django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================================================== 2 errors in 0.37s ======================================================================================================================
`
Will need for naturally partitioned info sets - eg SKOS concepts organised into schemes
Hi,
I get the error ModuleNotFoundError: No module named 'rdf_io.protocols'
when I run makemigrations
for the first time.
I don't know if it's related but as I'm using Django 3.0, I also get the error django 3.0.4 - cannot import name 'python_2_unicode_compatible'
; so I have replaced from django.utils.encoding import python_2_unicode_compatible
with: from six import python_2_unicode_compatible
(as indicaed here pinax/pinax-blog#128).
This should the support manage.py dumpdata and allow some basic testing.
Allow for pluggable handler - first targets LDP and Sesame, Take config from project settings - maybe assume a default of a local Apache Marmotta LDP ?
When a configuration is present, set up a signal that invokes the serialiser on post_save
Top aid in debugging and user understanding, show a "dry run" view of service chains that would be invoked in a inferencing/publishing workflow
Needed to make compatible with geonode again.
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.