Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • F factlib.js
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

Aufgrund einer Storage Wartung wird GitLab zwischen 10 und 14:30 Uhr nicht oder nur teilweise zur Verfügung stehen. / Due to storage maintenance, GitLab will not be available or only partially available between 10am and 2:30pm.

  • i5i5
  • FactDAG
  • factlib.js
  • Issues
  • #38
Closed
Open
Issue created Aug 17, 2020 by Leon Müller@leon.muellerDeveloper

Binary Resource Bug

Beim Erstellen von Binary Resources geht der rdf store verloren, was die Ressourcen nach dem Erstellen unbenutzbar macht.

Ein Beispiel Programm welches den Zustand des Facts/stores an verschiedenen Stellen der Erstellung zeigt (ausführbar in "/examples/binaryExample/"):

test.ts

1. Nach Erstellung eines Candidates:

const candidate = service.getFactDagResourceFactory().createEmptyBinaryFactCandidate(resourceID, fs.createReadStream("./src/logo.png"), "image/png");
candidate.attributeToAuthority(idFactory.createAuthorityResourceID(authorityID));
candidate.addGeneratingActivity(activity)
console.log(candidate.resourceID)
console.log(candidate.serialize())

Output:

LdpResourceID {
  toString: [Function (anonymous)],
  _authorityID: 'http://localhost:8082',
  _resourceID: '/facts/imgTest'
}
@prefix : </#>.
@prefix f: </facts/>.
@prefix prov: <http://www.w3.org/ns/prov#>.

f:imgTest
    a prov:Entity;
    prov:wasAttributedTo
    "fact::http://localhost:8082/.well-known/factdag-authority";
    prov:wasGeneratedBy
    "fact:2020-08-17T10:03:25.000Z:http://localhost:8082/activities/binaryTest".

2. Nach Erstellen des Facts:

const fact = await service.createBinaryFactResource(candidate);
console.log(fact.factID)
console.log(fact.serialize())

Output:

LdpFactID {
  toString: [Function (anonymous)],
  _authorityID: 'http://localhost:8082',
  _resourceID: '/facts/imgTest',
  _revisionID: undefined
}
@prefix : </#>.

3. Und nach Abfrage der letzten Revision:

const resource = await service.getLastBinaryFactRevision(resourceID,"image/png");
console.log(resource.factID)
console.log(resource.serialize())

Output:

LdpFactID {
  toString: [Function (anonymous)],
  _authorityID: 'http://localhost:8082',
  _resourceID: '/facts/imgTest',
  _revisionID: 2020-08-17T10:03:26.000Z
}
@prefix : </#>.

Der rdf store wird also nicht mit in den Fact übernommen. Jegliche Methode die versucht die Resource zu nutzen, z.B. service.getRevisionListByID() schlägt fehl mit

Error: This resources cannot be interpreted as a FactDAG element at Function.determineCorrectResource

Seltsamerweise scheint es allerdings noch einen zweiten store zu geben auf den beispielsweise trellis zugreift, da in der trellis Webansicht folgendes steht:

Screenshot_2020-08-17_at_12.53.48

In createBinaryFactResource() wird candidate.store bereits nicht mehr verwendet:

public async createBinaryFactResource(candidate: BinaryFactCandidate<EmptyTrunk | LdpTrunk>): Promise<BinaryFact<LdpTrunk>> {
        const location = candidate.resourceID.directory;
        const ldpResource = await this.ldpClient.createLDPNonRDFSource(location, candidate.resourceID.resourceName, candidate.binaryContent, candidate.contentType);
        const givenResourceID = this.idFactory.parseURIToResourceID(ldpResource.resourceURI.toString());
        return this.factDagResourceFactory.createBinaryFact(ldpResource, givenResourceID);
    }
Assignee
Assign to
Time tracking