mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Only set content-type for documents in sparql store
This commit is contained in:
parent
35aec9cce7
commit
d7e189cdd8
@ -95,7 +95,9 @@ export class SparqlDataAccessor implements DataAccessor {
|
||||
}
|
||||
|
||||
const metadata = new RepresentationMetadata(identifier.path).addQuads(quads);
|
||||
if (!isContainerIdentifier(identifier)) {
|
||||
metadata.contentType = INTERNAL_QUADS;
|
||||
}
|
||||
|
||||
// Need to generate type metadata for the root container since it's not stored
|
||||
if (identifier.path === this.base) {
|
||||
|
@ -105,7 +105,6 @@ describe('A SparqlDataAccessor', (): void => {
|
||||
metadata = await accessor.getMetadata({ path: 'http://container/' });
|
||||
expect(metadata.quads()).toBeRdfIsomorphic([
|
||||
quad(namedNode('this'), namedNode('a'), namedNode('triple')),
|
||||
quad(namedNode('http://container/'), toNamedNode(CONTENT_TYPE), literal(INTERNAL_QUADS)),
|
||||
]);
|
||||
|
||||
expect(fetchTriples).toHaveBeenCalledTimes(1);
|
||||
@ -123,7 +122,6 @@ describe('A SparqlDataAccessor', (): void => {
|
||||
metadata = await accessor.getMetadata({ path: base });
|
||||
expect(metadata.quads()).toBeRdfIsomorphic([
|
||||
quad(namedNode('this'), namedNode('a'), namedNode('triple')),
|
||||
quad(namedNode(base), toNamedNode(CONTENT_TYPE), literal(INTERNAL_QUADS)),
|
||||
quad(namedNode(base), toNamedNode(RDF.type), toNamedNode(LDP.Container)),
|
||||
quad(namedNode(base), toNamedNode(RDF.type), toNamedNode(LDP.BasicContainer)),
|
||||
quad(namedNode(base), toNamedNode(RDF.type), toNamedNode(LDP.Resource)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user