Coder Social home page Coder Social logo

Comments (3)

ali1k avatar ali1k commented on August 20, 2024

Hi @angelf ,
at the moment you can only edit existing RDF resources (i.e. cannot add new resources). However, there is a config called 'allowExtension' which provides a feature to add arbitrary properties to a resource object. You can checkout an example at https://github.com/ali1k/ld-r/blob/master/configs/reactor.sample.js
line 89 which shows adding extensions for a property.

from ld-r.

angelf avatar angelf commented on August 20, 2024

Hi,

Thank-you. I have reviewed the sample config but I am struggling a bit on the workings of allowExtension. If I understand it correctly allowExtension enables editing of properties of related resources. So, in reactor.sample.js enabling allowExtension on 'http://purl.org/dc/terms/creator' and defining the extensions specs allows me to edit the rdfs:label, foaf:mbox, and rdf:label properties on the relateddct:creator resource.

What I want to this point is something more basic: just allowing users to enter new literal properties to an object. So far I am able to edit literal properties, as long as they already have a value, but I can't see how to define new literals on an existing resource.

To make it a bit more concrete, let's say I want to enable adding the dct:description property in any Resource on my dataset, I would expect this

                'http://purl.org/dc/terms/description': {
                    label: ['Textual description'],
                    hint: ['A textual description of the dataset.'],
                    objectIEditor: ['BasicTextareaInput'],
                    allowExtension: 1,

would allow me to add this property.

What am I getting wrong?

from ld-r.

ali1k avatar ali1k commented on August 20, 2024

'allowExtension' allows extending resources derived from current resources. If you enable 'allowNewValue' together with 'allowExtension' on a property with URI object values, then you can add details to the object after its creation. E.g in the config for http://purl.org/dc/terms/creator property, if I add an object like http://ali1k.com then I can click on the 'add details button' and will get the properties defined in the 'extensions' array. This will allow you to add non-existing properties to this resource. For your example, you need to add the following config to the 'generic' property config:

'generic': {
allowExtension: 1,
allowNewValue: 1,
extensions: [
 {
      spec: {
                 propertyURI: 'http://purl.org/dc/terms/description',
                 instances: [{value: 'desc...', valueType: 'literal'}]
        },
       config: {
            label: ['Description']
      }
 }
]
}

from ld-r.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.