mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
chore: Remove assumption that DataAccessors have a root container by default
This commit is contained in:
@@ -27,7 +27,6 @@ import { guardStream } from '../../util/GuardedStream';
|
||||
import type { Guarded } from '../../util/GuardedStream';
|
||||
import type { IdentifierStrategy } from '../../util/identifiers/IdentifierStrategy';
|
||||
import { isContainerIdentifier } from '../../util/PathUtil';
|
||||
import { generateResourceQuads } from '../../util/ResourceUtil';
|
||||
import { CONTENT_TYPE, LDP } from '../../util/UriConstants';
|
||||
import { toNamedNode } from '../../util/UriUtil';
|
||||
import type { DataAccessor } from './DataAccessor';
|
||||
@@ -90,8 +89,7 @@ export class SparqlDataAccessor implements DataAccessor {
|
||||
const stream = await this.sendSparqlConstruct(query);
|
||||
const quads = await arrayifyStream(stream);
|
||||
|
||||
// Root container will not have metadata if there are no containment triples
|
||||
if (quads.length === 0 && !this.identifierStrategy.isRootContainer(identifier)) {
|
||||
if (quads.length === 0) {
|
||||
throw new NotFoundHttpError();
|
||||
}
|
||||
|
||||
@@ -100,11 +98,6 @@ export class SparqlDataAccessor implements DataAccessor {
|
||||
metadata.contentType = INTERNAL_QUADS;
|
||||
}
|
||||
|
||||
// Need to generate type metadata for the root container since it's not stored
|
||||
if (this.identifierStrategy.isRootContainer(identifier)) {
|
||||
metadata.addQuads(generateResourceQuads(name, true));
|
||||
}
|
||||
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user