Giter Club home page Giter Club logo

ldkit's People

Contributors

danielbeeke avatar karelklima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ldkit's Issues

Support language filtering on SPARQL level

Consider supporting language filtering on SPARQL level.

For example, for schema:

const Person = {
  "@type": schema.Person,
  name: {
    "@id": schema.name,
    "@language": "cs"
  }
};

When querying, the SPARQL query would filter only values with cs language for the schema:name property.

Support named graph constraint for resources

It should be possible to pass a graph IRI to a resource context, effectively restricting all SPARQL queries to the particular graph.

This is useful for focusing resources / queries over a particular graph / context in a database.

Extend LDkit schema interface to allow for advanced operations

For additional developer experience, LDkit should allow for the following:

  • Matching of entities based on a partial entity, e.g. lens.match({ name: "Abc"});
  • Working with huge arrays, e.g. lens.update({ $id, prop: { $add: "value"; });

This may require to extend LDkit language significantly. An alternative approach would be to use a proxy and translate actions on objects to SPARQL UPDATE queries, e.g. res.property.push("value") and then res.update(property) would yield the same result.

Consider using MongoDB language as an inspiration.

Add support for RDF collections

LDkit could support collections for greater benefits of developers.

Prerequisites:

  • Standardized collection format
  • Support for collections within SPARQL query

Document creating a schema

Include:

  • Basic principles
  • Shortcuts
  • Simple properties
  • Array / non-array properties
  • Multilang properties
  • Subschemas
  • Schema composition and reusability

Add support for custom logger

It should be possible to configure custom logger, and perhaps override the default one, using some reasonable interface. It should be compatible with the most prominent logging solutions in both Deno and Node.

Improve interface of lens.find method

The interface should enable user to do more powerful queries, order results, and find specific resources more easily.

Prisma could be a good inspiration in what to accomplish:

const results = await prisma.post.findMany({
  skip: 200,
  take: 20,
  where: {
    email: {
      contains: 'Prisma',
    },
  },
  orderBy: {
    title: 'desc',
  },
})

Relax requirement for application/rdf+json in queryQuads

Some SPARQL servers like Oxigraph which I am using do not support application/rdf+json in CONSTRUCT/DESCRIBE queries. I currently convert text/turtle to json manually in a custom fetch function.
What would be the best way ti support this?

Make type optional for schema definition

Currently the schema requires the user to have a type, which is fine for main entities, but may be a problem for sub schemas or generally substructures in schema. Therefore it should be possible to define a schema and the data shape without the type.

For a schema to be valid, at least a type or one property must be defined.

Support array modifications using the update interface

Right now it is not straightforward to update arrays, users either need to provide the whole array as a replacement, or directly insert or delete quads. It is also not clear how this behavior works for subschemas.

The goal is to support array modification using $set, $add and $remove operators.

The array operations will only consider literals or IRIs, not complex objects, i.e. it should be possible to create connections between a schema and subschema entity, but the operation should not result in updating an entity in an array. That would be confusing and unwanted.

Example:

Persons.update({
  $id: "http://some/person",
  friends: {
    $add: ["http://second/person"],
    $remove: ["http://third/person"]
  }
})

Related work: #48

Add support for lazy properties evaluation

Improve LDkit performance by allowing some properties to be lazy loaded, so that the user has to await them before being used.

Considerations:

  • optional / required - the lazy properties would have to be optional, does not matter whether if it is an array or not
  • allow for simple properties and subschemas - useful for huge arrays
  • Decoder / Encoder would have to be reworked significantly to allow injection of functions to resulting data

Add support for inverse properties in schema

It should be possible to specify that a property in schema is @inversed, reversing the triple pattern matching (s p o -> o p s). Useful for querying data with incoming links.

Choose better name for "Resource"

Options:

  • resource lens / lens
  • data interface
  • entity repository
  • executor / executive
  • bridge
  • adapter

Alternative options:

  • data link
  • agent
  • broker
  • access point
  • connection

Remove autoloading of all RDF types for a schema entity

LDkit currently loads all RDF types of main entities in schemas, which has a performance impact, especially on the query engine / SPARQL endpoint.

TODO:

  1. Remove autoloading of entity types
  2. Figure out a way how to replace this feature explicitly, e.g. using a custom method in a schema.

Reconsider language support mode

Currently, it is possible to set a language within the Context, which has its negatives. As an alternative, consider instead adding support to filter certain fields by language using the find method and the where specification.

Improve typings of results coming from lens

Currently the typings of results coming from lens are resolved as SchemaInterface<{ property: ... }> and developers can see this wrapped schema instead of the actual objects and properties. Provide a better type resolution to "unwrap" the types.

Add proper support for pagination

At the moment it is possible to specify limit of entities to query and pagination must be done in client side. Users should be able to specify offset and limit when querying for entities.

Remove AsyncIterator dependency

The AsyncIterator dependency is based on Node EventEmitter, which cannot be used in browser without polyfill. Since the dependency is not heavily used, it should be removed in favor of regular async iteration.

Drop support for multilang arrays

Multilanguage arrays may be confusing and not really a relevant feature, consider dropping support. Not sure what is the use case for that anyway, besides perhaps cleaning up messy data.

Allow for QueryBuilder to be easily replacable

While it is possible to replace QueryBuilder component in LDkit during runtime, it is not straightforward and the API for this is not documented. Users should be able to define a custom QueryBuilder so that they can modify SPARQL queries or perhaps implement custom query languages more easily if needed.

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.