Skip to content

Add code for specifying an additional context that's not specific to a single term #20

@rosanna-smith

Description

@rosanna-smith

We'll need to work out how to add an extra part to parseContextSheet() in workbook.js so that an additional context can be specified in a spreadsheet with the name * and @id https://w3id.org/ldac/terms#. PT and I created a partially working test with test data below:

it("Can add add a complete vocabulary to the context with no prefix", async function () {
        this.timeout(5000);
        const excelFilePath = "test_data/ldac-context-workbook.xlsx";
        // New empty crate
        var c = new ROCrate({array: true, link: true});

        const workbook2 = new Workbook({crate: c});
        await workbook2.loadExcel(excelFilePath, true); // true here means add to crate not
        //console.log(JSON.stringify(workbook2.crate.toJSON(), null, 2));

        await workbook2.crate.resolveContext();
        const langURI = workbook2.crate.resolveTerm("subjectLanguage");
        assert.equal(langURI, "https://w3id.org/ldac/terms#subjectLanguage", "Resolved context term")
//finish later: check correct context entry, check it has the right key
    });

ldac-context-workbook.xlsx

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions