Commit d29ad91a authored by Laurent Wouters's avatar Laurent Wouters
Browse files

[fix] Fixing problem with resources with multiple alternative URIs

parent 37cf73e243cb
......@@ -119,17 +119,9 @@ export interface Resource {
* @param uri The 'main' URI
*/
export function newResourceFromUri(uri: string): Resource {
return newResource(...uriEquivalents(uri));
}
/**
* Creates a new resource
* @param uris The set of URIs
*/
export function newResource(...uris: string[]): Resource {
return {
uri: uris[0],
uris: uris
uri: uri,
uris: uriEquivalents(uri)
};
}
......
......@@ -19,7 +19,7 @@
******************************************************************************/
import * as $rdf from "rdflib";
import { Resource, uriEquivalents, newResource } from "./application";
import { Resource, uriEquivalents } from "./application";
/**
* A single RDF entity that may have aliases
......@@ -37,6 +37,10 @@ export class RdfEntity {
* All the uris for this node
*/
public readonly uris: string[];
/**
* The first found URI
*/
public readonly uri: string;
/**
* Initializes this entity
......@@ -47,13 +51,17 @@ export class RdfEntity {
this.manager = manager;
this.aliases = [first];
this.uris = [first.uri];
this.uri = first.uri;
}
/**
* Converts this entity to a resource
*/
public toResource(): Resource {
return newResource(...this.uris);
return {
uri: this.uri,
uris: this.uris
};
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment