p2m2 / discovery

Discovery provides a powerful toolset for developers who are looking to build UIs using RDF data in an a robust software development process
https://p2m2.github.io/discovery/
MIT License
0 stars 1 forks source link

Bad management of pagination [Forum/Vuejs] #207

Open ofilangi opened 7 months ago

ofilangi commented 7 months ago

to reproduce data Demo 1 - Compound to MeSH; PubChem; 1060 - Pyruvic acid | D005947 (Glucose)

SWDiscoveryConfiguration
                 .init()
                 .sparqlEndpoint(this.url)
                 .setPageSize(this.pageSize)
                 .setSizeBatchProcessing(this.batchProcessing)
                 .setLogLevel(this.logLevel)
                 .setCache(this.cache)

SWDiscovery(config)
        .directive('DEFINE input:inference "schema-inference-rules"')
        .prefix("dcterm", "http://purl.org/dc/terms/")
        .prefix("cid", "http://rdf.ncbi.nlm.nih.gov/pubchem/compound/")
        .prefix("cito", "http://purl.org/spar/cito/")
        .prefix("meshv", "http://id.nlm.nih.gov/mesh/vocab#")
        .prefix("mesh", "http://id.nlm.nih.gov/mesh/")
        .prefix("fabio", "http://purl.org/spar/fabio/")
        .something("cid")
        .set(URI("cid:" + cidRequest))
        .isSubjectOf(URI("cito:isDiscussedBy"), "pmid")
        .datatype(URI("http://purl.org/dc/terms/title"), "title")
        .datatype(URI("http://purl.org/dc/terms/date"), "date")
        .isSubjectOf(
          PropertyPath(
            "fabio:hasSubjectTerm|fabio:hasSubjectTerm/meshv:hasDescriptor"
          ),
          "mesh_ini"
        )
        .isSubjectOf(
          PropertyPath(
            "meshv:treeNumber|meshv:treeNumber/meshv:parentTreeNumber"
          )
        )
        .isObjectOf(URI("meshv:treeNumber"))
        .set(URI("mesh:" + meshid))
        .focus("mesh_ini")
        .isA(URI("meshv:TopicalDescriptor"))
        .focus("mesh_ini")
        .isSubjectOf("meshv:active")
        .set(Literal(1))
        .focus("pmid")
        .isSubjectOf("dcterm:date", "dateToOrdered")
        //.console()
        .selectDistinctByPage("pmid", "title", "date")
        .then(( args: [number,(SWTransaction[])] ) => {
          let numberOfPages: number = Object.values(args)[0] as number;
          let lazyPage: SWTransaction[] = Object.values(
            args
          )[1] as Array<SWTransaction>;
          resolve([numberOfPages, lazyPage]);
        })
        .catch((error: any) => {
          reject(error);
        });
ofilangi commented 7 months ago

Clue to find the bug. It may involve adding the directive. directive('DEFINE input:inference "schema-inference-rules"')