Skip to content

Commit 9cae83d

Browse files
committed
equivalent properties handled
1 parent e9f4473 commit 9cae83d

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

src/solid/EmailDataset.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import { VCARD } from '../vocabulary/mod.js';
33
import { Email } from './Email.js';
44

55
export class EmailDataset extends DatasetWrapper {
6-
get email(): Iterable<Email> {
7-
return this.objectsOf(VCARD.hasEmail, Email);
6+
get emails(): Iterable<Email> {
7+
const objects = new Set([
8+
...this.instancesOf(VCARD.Email, Email),
9+
...this.objectsOf(VCARD.hasEmail, Email),
10+
...this.objectsOf(VCARD.email, Email),
11+
])
12+
13+
return objects
814
}
915
}

src/solid/TelephoneDataset.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { VCARD } from '../vocabulary/vcard.js';
33
import { Telephone } from './Telephone.js';
44

55
export class TelephoneDataset extends DatasetWrapper {
6-
get telephone(): Iterable<Telephone> {
7-
return this.objectsOf(VCARD.hasTelephone, Telephone);
6+
get telephones(): Iterable<Telephone> {
7+
const objects = new Set([
8+
...this.objectsOf(VCARD.hasTelephone, Telephone),
9+
...this.objectsOf(VCARD.tel, Telephone),
10+
])
11+
12+
return objects
813
}
914
}

src/vocabulary/vcard.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
export const VCARD = {
22
fn: "http://www.w3.org/2006/vcard/ns#fn",
3+
Email: "http://www.w3.org/2006/vcard/ns#Email",
34
email: "http://www.w3.org/2006/vcard/ns#email",
45
hasEmail: "http://www.w3.org/2006/vcard/ns#hasEmail",
56
hasValue: "http://www.w3.org/2006/vcard/ns#hasValue",
67
hasPhoto: "http://www.w3.org/2006/vcard/ns#hasPhoto",
8+
tel: "http://www.w3.org/2006/vcard/ns#tel",
79
hasTelephone: "http://www.w3.org/2006/vcard/ns#hasTelephone",
810
title: "http://www.w3.org/2006/vcard/ns#title",
911
hasUrl: "http://www.w3.org/2006/vcard/ns#hasUrl",

0 commit comments

Comments
 (0)