peterjohnlawrence / com.inova8.odata2sparql.v4

Part of the overall odata2sparql solution, this odata2sparql.v4 module containing the olingo4 dependencies. In other words specifically for odata v4
http://inova8.com/bg_inova8.com/offerings/odata2sparql/
Apache License 2.0
5 stars 5 forks source link

Adding new properties/classes #195

Open deliaiuga23 opened 4 years ago

deliaiuga23 commented 4 years ago

Hi Peter,

Thanks a lot for your work; I was able to make it run and implement a small application in which I can retrieve my data from Blazegraph but also alter it by updating or deleting it.

Now I would like to extend my app and allow a user to define new properties for a certain class, or even to create a new class, populate it and then save it into Blazegraph.

My first instinct was to try to add the new property in the body of a PATCH call. I got an error, of course, saying the new property cannot be mapped as a property or an annotation. I kind of expecting that but I thought I could just give it a try :)

Could you tell me, is there a way to update the domain model through your software?

Thank you for your help,

Best regards, Delia

peterjohnlawrence commented 4 years ago

<<My first instinct was to try to add the new property in the body of a PATCH call. I got an error, of course, saying the new property cannot be mapped as a property or an annotation. I kind of expecting that but I thought I could just give it a try :)>>

Yes this is an 'issue' with OData: it assumes that the set of properties is closed for a particular entity. However OData does support the concept of an 'OpenType dynamic property' , see http://docs.oasis-open.org/odata/odata/v4.0/os/part3-csdl/odata-v4.0-os-part3-csdl.html#_Toc372793935, however the Olingo base library that I use will neither serialize such properties as output nor accept them as part of an insert/update. I have posted a change request but nothing yet:-( https://issues.apache.org/jira/browse/OLINGO-1303

<<Could you tell me, is there a way to update the domain model through your software?>>

I guess your BlazeGraph contains your domain model (classes and properties) so OData2SPARQL will publish only that model.

However if you were to load the RDF and RDFS graph files into BlazeGraph explicity (http://www.w3.org/1999/02/22-rdf-syntax-ns and http://www.w3.org/2000/01/rdf-schema) then you can manipulate the rdfs Classes (add new ones etc), the rdf Properties (add new properties, define their domain and range properties etc). If you wanted to manipulate an OWL model then also load the owl schema file (http://www.w3.org/2002/07/owl), then manipulate objectProperty etc.

Note that if you dynamically add properties and/or classes it will be necessary to reset your domain model before OData2SPARQL will handle request: .../ODAT2SPARQL/$reset/

I hope this helps

Peter J. Lawrence inova8 Providing answers for users' information questions Mobile: +44 7546 095977 | +1 330 631 3772 | Phone: +44 1298 872375 | Skype: PeterJLawrence Email: peter.lawrence@inova8.com | peter.lawrence@nexifysolutions.com peter.lawrence@inova8.com | Web: www.inova8.com LinkedIn:

http://www.linkedin.com/in/peterjohnlawrence http://www.linkedin.com/in/peterjohnlawrence

On Fri, 25 Sep 2020 at 14:43, deliaiuga23 notifications@github.com wrote:

Hi Peter,

Thanks a lot for your work; I was able to make it run and implement a small application in which I can retrieve my data from Blazegraph but also alter it by updating or deleting it.

Now I would like to extend my app and allow a user to define new properties for a certain class, or even to create a new class, populate it and then save it into Blazegraph.

My first instinct was to try to add the new property in the body of a PATCH call. I got an error, of course, saying the new property cannot be mapped as a property or an annotation. I kind of expecting that but I thought I could just give it a try :)

Could you tell me, is there a way to update the domain model through your software?

Thank you for your help,

Best regards, Delia

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/peterjohnlawrence/com.inova8.odata2sparql.v4/issues/195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMJVMBLHAXWD64NJVLMULTSHSNBTANCNFSM4RZSAHDA .