diff --git a/package.json b/package.json index d24e608..7f6b656 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ ], "license": "MIT", "dependencies": { - "rdfjs-wrapper": "^0.15.0" + "rdfjs-wrapper": "^0.29.0" }, "devDependencies": { "@rdfjs/types": "^2", diff --git a/src/solid/AccessControlPolicy.ts b/src/solid/AccessControlPolicy.ts new file mode 100644 index 0000000..818a1b3 --- /dev/null +++ b/src/solid/AccessControlPolicy.ts @@ -0,0 +1,8 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class AccessControlPolicy extends TermWrapper { + + get type(): Set { + return this.objects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/AccessControlResource.ts b/src/solid/AccessControlResource.ts new file mode 100644 index 0000000..9bc62e5 --- /dev/null +++ b/src/solid/AccessControlResource.ts @@ -0,0 +1,15 @@ +import { AcpAccessControl } from './AcpAccessControl.js'; +import { TermWrapper, ValueMapping, TermMapping, ObjectMapping } from "rdfjs-wrapper"; + +export class AccessControlResource extends TermWrapper { + + get accessControl(): Set { + return this.objects("http://www.w3.org/ns/solid/acp#accessControl", ObjectMapping.as(AcpAccessControl), ObjectMapping.as(AcpAccessControl)); + } + get resource(): string | undefined { + return this.singularNullable("http://www.w3.org/ns/solid/acp#resource", ValueMapping.iriToString); + } + set resource(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/ns/solid/acp#resource", value, TermMapping.stringToIri); + } +} diff --git a/src/solid/AcpAccessControl.ts b/src/solid/AcpAccessControl.ts new file mode 100644 index 0000000..4d390e7 --- /dev/null +++ b/src/solid/AcpAccessControl.ts @@ -0,0 +1,9 @@ +import { AccessControlPolicy } from './AccessControlPolicy.js'; +import { TermWrapper, ObjectMapping } from "rdfjs-wrapper"; + +export class AcpAccessControl extends TermWrapper { + + get apply(): Set { + return this.objects("http://www.w3.org/ns/solid/acp#apply", ObjectMapping.as(AccessControlPolicy), ObjectMapping.as(AccessControlPolicy)); + } +} diff --git a/src/solid/AcpMatcher.ts b/src/solid/AcpMatcher.ts new file mode 100644 index 0000000..ce3e0e3 --- /dev/null +++ b/src/solid/AcpMatcher.ts @@ -0,0 +1,8 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class AcpMatcher extends TermWrapper { + + get agent(): Set { + return this.objects("http://www.w3.org/ns/solid/acp#agent", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/Address.ts b/src/solid/Address.ts new file mode 100644 index 0000000..b446cc7 --- /dev/null +++ b/src/solid/Address.ts @@ -0,0 +1,35 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class Address extends TermWrapper { + + get streetAddress(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#street-address", ValueMapping.literalToString); + } + set streetAddress(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#street-address", value, TermMapping.stringToLiteral); + } + get locality(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#locality", ValueMapping.literalToString); + } + set locality(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#locality", value, TermMapping.stringToLiteral); + } + get postalCode(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#postal-code", ValueMapping.literalToString); + } + set postalCode(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#postal-code", value, TermMapping.stringToLiteral); + } + get region(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#region", ValueMapping.literalToString); + } + set region(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#region", value, TermMapping.stringToLiteral); + } + get countryName(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#country-name", ValueMapping.literalToString); + } + set countryName(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#country-name", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/AddressBook.ts b/src/solid/AddressBook.ts new file mode 100644 index 0000000..4af8bae --- /dev/null +++ b/src/solid/AddressBook.ts @@ -0,0 +1,26 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class AddressBook extends TermWrapper { + + get formattedName(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#fn", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get nameEmailIndex(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#nameEmailIndex", ValueMapping.iriToString, TermMapping.stringToIri); + } + get groupIndex(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#groupIndex", ValueMapping.iriToString); + } + set groupIndex(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#groupIndex", value, TermMapping.stringToIri); + } + get includesGroup(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#includesGroup", ValueMapping.iriToString, TermMapping.stringToIri); + } + get inAddressBook(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#inAddressBook", ValueMapping.iriToString); + } + set inAddressBook(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#inAddressBook", value, TermMapping.stringToIri); + } +} diff --git a/src/solid/Bookmark.ts b/src/solid/Bookmark.ts new file mode 100644 index 0000000..9969f7b --- /dev/null +++ b/src/solid/Bookmark.ts @@ -0,0 +1,17 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class Bookmark extends TermWrapper { + + get label(): Set { + return this.objects("http://www.w3.org/2000/01/rdf-schema#label", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get url(): Set { + return this.objects("http://www.w3.org/2002/01/bookmark#recalls", ValueMapping.iriToString, TermMapping.stringToIri); + } + get topic(): Set { + return this.objects("http://www.w3.org/2002/01/bookmark#hasTopic", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get description(): Set { + return this.objects("http://www.w3.org/2000/01/rdf-schema#comment", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/ChatAction.ts b/src/solid/ChatAction.ts new file mode 100644 index 0000000..73ca1fe --- /dev/null +++ b/src/solid/ChatAction.ts @@ -0,0 +1,14 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class ChatAction extends TermWrapper { + + get type(): Set { + return this.objects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get agent(): string | undefined { + return this.singularNullable("https://schema.org/agent", ValueMapping.literalToString); + } + set agent(value: string | undefined) { + this.overwriteNullable("https://schema.org/agent", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/ChatChannel.ts b/src/solid/ChatChannel.ts new file mode 100644 index 0000000..0951dec --- /dev/null +++ b/src/solid/ChatChannel.ts @@ -0,0 +1,31 @@ +import { ChatSharedPreferences } from './ChatSharedPreferences.js'; +import { Participation } from './Participation.js'; +import { TermWrapper, ValueMapping, TermMapping, ObjectMapping } from "rdfjs-wrapper"; + +export class ChatChannel extends TermWrapper { + + get type(): Set { + return this.objects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get author(): Set { + return this.objects("http://purl.org/dc/elements/1.1/author", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get title(): string { + return this.singular("http://purl.org/dc/elements/1.1/title", ValueMapping.literalToString); + } + set title(value: string) { + this.overwrite("http://purl.org/dc/elements/1.1/title", value, TermMapping.stringToLiteral); + } + get createdDate(): Date { + return this.singular("http://purl.org/dc/elements/1.1/created", ValueMapping.literalToDate); + } + set createdDate(value: Date) { + this.overwrite("http://purl.org/dc/elements/1.1/created", value, TermMapping.dateToLiteral); + } + get sharedPreferences(): Set { + return this.objects("http://www.w3.org/ns/ui#sharedPreferences", ObjectMapping.as(ChatSharedPreferences), ObjectMapping.as(ChatSharedPreferences)); + } + get participation(): Set { + return this.objects("http://www.w3.org/2005/01/wf/flow#participation", ObjectMapping.as(Participation), ObjectMapping.as(Participation)); + } +} diff --git a/src/solid/ChatMessage.ts b/src/solid/ChatMessage.ts new file mode 100644 index 0000000..bc77372 --- /dev/null +++ b/src/solid/ChatMessage.ts @@ -0,0 +1,26 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class ChatMessage extends TermWrapper { + + get createdDate(): Date { + return this.singular("http://purl.org/dc/terms/created", ValueMapping.literalToDate); + } + set createdDate(value: Date) { + this.overwrite("http://purl.org/dc/terms/created", value, TermMapping.dateToLiteral); + } + get author(): string { + return this.singular("http://xmlns.com/foaf/0.1/maker", ValueMapping.literalToString); + } + set author(value: string) { + this.overwrite("http://xmlns.com/foaf/0.1/maker", value, TermMapping.stringToLiteral); + } + get content(): string { + return this.singular("http://rdfs.org/sioc/ns#content", ValueMapping.literalToString); + } + set content(value: string) { + this.overwrite("http://rdfs.org/sioc/ns#content", value, TermMapping.stringToLiteral); + } + get relatedChatChannel(): Set { + return this.objects("n3-52", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/ChatSharedPreferences.ts b/src/solid/ChatSharedPreferences.ts new file mode 100644 index 0000000..4b7fbf8 --- /dev/null +++ b/src/solid/ChatSharedPreferences.ts @@ -0,0 +1,23 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class ChatSharedPreferences extends TermWrapper { + + get expandImagesInline(): boolean | undefined { + return this.singularNullable("http://www.w3.org/ns/solid/terms#expandImagesInline", ValueMapping.literalToString); + } + set expandImagesInline(value: boolean | undefined) { + this.overwriteNullable("http://www.w3.org/ns/solid/terms#expandImagesInline", value, TermMapping.stringToLiteral); + } + get inlineImageHeight(): number | undefined { + return this.singularNullable("http://www.w3.org/ns/solid/terms#inlineImageHeightEms", ValueMapping.literalToNumber); + } + set inlineImageHeight(value: number | undefined) { + this.overwriteNullable("http://www.w3.org/ns/solid/terms#inlineImageHeightEms", value, TermMapping.numberToLiteral); + } + get newestFirst(): boolean | undefined { + return this.singularNullable("http://www.w3.org/ns/solid/terms#newestFirst", ValueMapping.literalToString); + } + set newestFirst(value: boolean | undefined) { + this.overwriteNullable("http://www.w3.org/ns/solid/terms#newestFirst", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/ContactDetailsOrganization.ts b/src/solid/ContactDetailsOrganization.ts new file mode 100644 index 0000000..87a6aa7 --- /dev/null +++ b/src/solid/ContactDetailsOrganization.ts @@ -0,0 +1,29 @@ +import { Address } from './Address.js'; +import { EmailWithType } from './EmailWithType.js'; +import { Telephone } from './Telephone.js'; +import { TermWrapper, ValueMapping, TermMapping, ObjectMapping } from "rdfjs-wrapper"; + +export class ContactDetailsOrganization extends TermWrapper { + + get organizationType(): Set { + return this.objects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get name(): Set { + return this.objects("http://schema.org/name", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get homepageURL(): Set { + return this.objects("http://schema.org/url", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get hasAddress(): Set
{ + return this.objects("http://www.w3.org/2006/vcard/ns#hasAddress", ObjectMapping.as(Address), ObjectMapping.as(Address)); + } + get hasEmailAddress(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasEmail", ObjectMapping.as(EmailWithType), ObjectMapping.as(EmailWithType)); + } + get hasTelephoneNumber(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasTelephone", ObjectMapping.as(Telephone), ObjectMapping.as(Telephone)); + } + get notes(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#note", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/ContactDetailsPerson.ts b/src/solid/ContactDetailsPerson.ts new file mode 100644 index 0000000..462a0e4 --- /dev/null +++ b/src/solid/ContactDetailsPerson.ts @@ -0,0 +1,47 @@ +import { Address } from './Address.js'; +import { EmailWithType } from './EmailWithType.js'; +import { Telephone } from './Telephone.js'; +import { TermWrapper, ValueMapping, TermMapping, ObjectMapping } from "rdfjs-wrapper"; + +export class ContactDetailsPerson extends TermWrapper { + + get fullName(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#fn", ValueMapping.literalToString); + } + set fullName(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#fn", value, TermMapping.stringToLiteral); + } + get role(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#role", ValueMapping.literalToString); + } + set role(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#role", value, TermMapping.stringToLiteral); + } + get organizationName(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#organization-name", ValueMapping.literalToString); + } + set organizationName(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#organization-name", value, TermMapping.stringToLiteral); + } + get address(): Set
{ + return this.objects("http://www.w3.org/2006/vcard/ns#hasAddress", ObjectMapping.as(Address), ObjectMapping.as(Address)); + } + get email(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasEmail", ObjectMapping.as(EmailWithType), ObjectMapping.as(EmailWithType)); + } + get telephone(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasTelephone", ObjectMapping.as(Telephone), ObjectMapping.as(Telephone)); + } + get dateOfBirth(): Date | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#bday", ValueMapping.literalToDate); + } + set dateOfBirth(value: Date | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#bday", value, TermMapping.dateToLiteral); + } + get notes(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#note", ValueMapping.literalToString); + } + set notes(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#note", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/ContactOrganization.ts b/src/solid/ContactOrganization.ts new file mode 100644 index 0000000..e6561c2 --- /dev/null +++ b/src/solid/ContactOrganization.ts @@ -0,0 +1,17 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class ContactOrganization extends TermWrapper { + + get name(): string | undefined { + return this.singularNullable("http://schema.org/name", ValueMapping.literalToString); + } + set name(value: string | undefined) { + this.overwriteNullable("http://schema.org/name", value, TermMapping.stringToLiteral); + } + get homepageURL(): Set { + return this.objects("http://schema.org/url", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get typeCategory(): Set { + return this.objects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/ContactPerson.ts b/src/solid/ContactPerson.ts new file mode 100644 index 0000000..404f0bd --- /dev/null +++ b/src/solid/ContactPerson.ts @@ -0,0 +1,83 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class ContactPerson extends TermWrapper { + + get Individual(): string | undefined { + return this.singularNullable("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString); + } + set Individual(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", value, TermMapping.stringToLiteral); + } + get fullName(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#fn", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get identifier(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#hasUID", ValueMapping.literalToString); + } + set identifier(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#hasUID", value, TermMapping.stringToLiteral); + } + get name(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#hasName", ValueMapping.literalToString); + } + set name(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#hasName", value, TermMapping.stringToLiteral); + } + get photo(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasPhoto", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get related(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasRelated", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get url(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#url", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get address(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasAddress", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get dateOfBirth(): Date | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#bday", ValueMapping.literalToDate); + } + set dateOfBirth(value: Date | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#bday", value, TermMapping.dateToLiteral); + } + get email(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasEmail", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get telephone(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasTelephone", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get organizationName(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#organization-name", ValueMapping.literalToString); + } + set organizationName(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#organization-name", value, TermMapping.stringToLiteral); + } + get role(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#role", ValueMapping.literalToString); + } + set role(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#role", value, TermMapping.stringToLiteral); + } + get title(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#title", ValueMapping.literalToString); + } + set title(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#title", value, TermMapping.stringToLiteral); + } + get notes(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#note", ValueMapping.literalToString); + } + set notes(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#note", value, TermMapping.stringToLiteral); + } + get sameAs(): Set { + return this.objects("http://www.w3.org/2002/07/owl#sameAs", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get inAddressBook(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#inAddressBook", ValueMapping.literalToString); + } + set inAddressBook(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#inAddressBook", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/Container.ts b/src/solid/Container.ts index fd6b0a2..dcefb20 100644 --- a/src/solid/Container.ts +++ b/src/solid/Container.ts @@ -1,9 +1,9 @@ -import { TermWrapper } from "rdfjs-wrapper" -import { Resource } from "./Resource.js" -import { LDP } from "../vocabulary/mod.js" +import { Resource } from './Resource.js'; +import { TermWrapper, ObjectMapping } from "rdfjs-wrapper"; -export class Container extends Resource { - public get contains(): Set { - return this.objects(LDP.contains, TermWrapper.as(Resource), TermWrapper.as(Resource)) - } +export class Container extends TermWrapper { + + get contains(): Set { + return this.objects("http://www.w3.org/ns/ldp#contains", ObjectMapping.as(Resource), ObjectMapping.as(Resource)); + } } diff --git a/src/solid/Email.ts b/src/solid/Email.ts index 505e4e0..ea970ce 100644 --- a/src/solid/Email.ts +++ b/src/solid/Email.ts @@ -1,20 +1,11 @@ -import { TermWrapper, ValueMappings, TermMappings } from 'rdfjs-wrapper'; -import { VCARD, RDF } from '../vocabulary/mod.js'; +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; export class Email extends TermWrapper { + get emailAddress(): string { - return this.singular(VCARD.value, ValueMappings.literalToString); + return this.singular("http://www.w3.org/2006/vcard/ns#value", ValueMapping.literalToString); } - set emailAddress(value: string) { - this.overwrite(VCARD.value, value, TermMappings.stringToLiteral); - } - - get emailType(): string | undefined { - return this.singularNullable(RDF.type, ValueMappings.iriToString); - } - - set emailType(value: string | undefined) { - this.overwriteNullable(RDF.type, value, TermMappings.stringToIri); + this.overwrite("http://www.w3.org/2006/vcard/ns#value", value, TermMapping.stringToLiteral); } } diff --git a/src/solid/EmailWithType.ts b/src/solid/EmailWithType.ts new file mode 100644 index 0000000..686bbcd --- /dev/null +++ b/src/solid/EmailWithType.ts @@ -0,0 +1,14 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class EmailWithType extends TermWrapper { + + get emailAddress(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#value", ValueMapping.literalToString); + } + set emailAddress(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#value", value, TermMapping.stringToLiteral); + } + get emailType(): Set { + return this.objects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/Group.ts b/src/solid/Group.ts new file mode 100644 index 0000000..1f6e53b --- /dev/null +++ b/src/solid/Group.ts @@ -0,0 +1,12 @@ +import { ContactDetailsPerson } from './ContactDetailsPerson.js'; +import { TermWrapper, ValueMapping, TermMapping, ObjectMapping } from "rdfjs-wrapper"; + +export class Group extends TermWrapper { + + get name(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#fn", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get member(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#member", ObjectMapping.as(ContactDetailsPerson), ObjectMapping.as(ContactDetailsPerson)); + } +} diff --git a/src/solid/GroupMemberLocalId.ts b/src/solid/GroupMemberLocalId.ts new file mode 100644 index 0000000..d3188df --- /dev/null +++ b/src/solid/GroupMemberLocalId.ts @@ -0,0 +1,11 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class GroupMemberLocalId extends TermWrapper { + + get sameAsIndividual(): string { + return this.singular("http://www.w3.org/2002/07/owl#sameAs", ValueMapping.literalToString); + } + set sameAsIndividual(value: string) { + this.overwrite("http://www.w3.org/2002/07/owl#sameAs", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/IssueTracker.ts b/src/solid/IssueTracker.ts new file mode 100644 index 0000000..dbd5a09 --- /dev/null +++ b/src/solid/IssueTracker.ts @@ -0,0 +1,37 @@ +import { IssueTrackerAssigneeGroup } from './IssueTrackerAssigneeGroup.js'; +import { PropertyListItem } from './PropertyListItem.js'; +import { TermWrapper, ValueMapping, TermMapping, ObjectMapping } from "rdfjs-wrapper"; + +export class IssueTracker extends TermWrapper { + + get title(): string | undefined { + return this.singularNullable("http://purl.org/dc/terms/title", ValueMapping.literalToString); + } + set title(value: string | undefined) { + this.overwriteNullable("http://purl.org/dc/terms/title", value, TermMapping.stringToLiteral); + } + get description(): string | undefined { + return this.singularNullable("http://www.w3.org/2005/01/wf/flow#description", ValueMapping.literalToString); + } + set description(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2005/01/wf/flow#description", value, TermMapping.stringToLiteral); + } + get issueState(): Set { + return this.objects("http://www.w3.org/2005/01/wf/flow#issueClass", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get issueCategory(): Set { + return this.objects("http://www.w3.org/2005/01/wf/flow#issueCategory", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get allowSubIssues(): boolean | undefined { + return this.singularNullable("http://www.w3.org/2005/01/wf/flow#allowSubIssues", ValueMapping.literalToString); + } + set allowSubIssues(value: boolean | undefined) { + this.overwriteNullable("http://www.w3.org/2005/01/wf/flow#allowSubIssues", value, TermMapping.stringToLiteral); + } + get additionalProperties(): Set { + return this.objects("http://www.w3.org/2005/01/wf/flow#propertyList", ObjectMapping.as(PropertyListItem), ObjectMapping.as(PropertyListItem)); + } + get assigneeGroup(): Set { + return this.objects("http://www.w3.org/2005/01/wf/flow#assigneeGroup", ObjectMapping.as(IssueTrackerAssigneeGroup), ObjectMapping.as(IssueTrackerAssigneeGroup)); + } +} diff --git a/src/solid/IssueTrackerAssigneeGroup.ts b/src/solid/IssueTrackerAssigneeGroup.ts new file mode 100644 index 0000000..deb81d1 --- /dev/null +++ b/src/solid/IssueTrackerAssigneeGroup.ts @@ -0,0 +1,15 @@ +import { IssueTrackerPerson } from './IssueTrackerPerson.js'; +import { TermWrapper, ValueMapping, TermMapping, ObjectMapping } from "rdfjs-wrapper"; + +export class IssueTrackerAssigneeGroup extends TermWrapper { + + get name(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#fn", ValueMapping.literalToString); + } + set name(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#fn", value, TermMapping.stringToLiteral); + } + get member(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#member", ObjectMapping.as(IssueTrackerPerson), ObjectMapping.as(IssueTrackerPerson)); + } +} diff --git a/src/solid/IssueTrackerPerson.ts b/src/solid/IssueTrackerPerson.ts new file mode 100644 index 0000000..739a2da --- /dev/null +++ b/src/solid/IssueTrackerPerson.ts @@ -0,0 +1,29 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class IssueTrackerPerson extends TermWrapper { + + get fullName(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#fn", ValueMapping.literalToString); + } + set fullName(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#fn", value, TermMapping.stringToLiteral); + } + get solidId(): string | undefined { + return this.singularNullable("http://www.w3.org/2002/07/owl#sameAs", ValueMapping.literalToString); + } + set solidId(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2002/07/owl#sameAs", value, TermMapping.stringToLiteral); + } + get phone(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#phone", ValueMapping.literalToString); + } + set phone(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#phone", value, TermMapping.stringToLiteral); + } + get emailAddress(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#email", ValueMapping.literalToString); + } + set emailAddress(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#email", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/Meeting.ts b/src/solid/Meeting.ts new file mode 100644 index 0000000..25834f2 --- /dev/null +++ b/src/solid/Meeting.ts @@ -0,0 +1,35 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class Meeting extends TermWrapper { + + get summary(): string | undefined { + return this.singularNullable("http://www.w3.org/2002/12/cal/ical#summary", ValueMapping.literalToString); + } + set summary(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2002/12/cal/ical#summary", value, TermMapping.stringToLiteral); + } + get location(): string | undefined { + return this.singularNullable("http://www.w3.org/2002/12/cal/ical#location", ValueMapping.literalToString); + } + set location(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2002/12/cal/ical#location", value, TermMapping.stringToLiteral); + } + get startDate(): Date | undefined { + return this.singularNullable("http://www.w3.org/2002/12/cal/ical#dtstart", ValueMapping.literalToDate); + } + set startDate(value: Date | undefined) { + this.overwriteNullable("http://www.w3.org/2002/12/cal/ical#dtstart", value, TermMapping.dateToLiteral); + } + get endDate(): Date | undefined { + return this.singularNullable("http://www.w3.org/2002/12/cal/ical#dtend", ValueMapping.literalToDate); + } + set endDate(value: Date | undefined) { + this.overwriteNullable("http://www.w3.org/2002/12/cal/ical#dtend", value, TermMapping.dateToLiteral); + } + get comment(): string | undefined { + return this.singularNullable("http://www.w3.org/2002/12/cal/ical#comment", ValueMapping.literalToString); + } + set comment(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2002/12/cal/ical#comment", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/Participation.ts b/src/solid/Participation.ts new file mode 100644 index 0000000..dee341c --- /dev/null +++ b/src/solid/Participation.ts @@ -0,0 +1,47 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class Participation extends TermWrapper { + + get startDate(): Date { + return this.singular("http://www.w3.org/2002/12/cal/ical#dtstart", ValueMapping.literalToDate); + } + set startDate(value: Date) { + this.overwrite("http://www.w3.org/2002/12/cal/ical#dtstart", value, TermMapping.dateToLiteral); + } + get participant(): string { + return this.singular("http://www.w3.org/2005/01/wf/flow#participant", ValueMapping.literalToString); + } + set participant(value: string) { + this.overwrite("http://www.w3.org/2005/01/wf/flow#participant", value, TermMapping.stringToLiteral); + } + get colorizeByAuthor(): boolean | undefined { + return this.singularNullable("http://www.w3.org/ns/solid/terms#colorizeByAuthor", ValueMapping.literalToString); + } + set colorizeByAuthor(value: boolean | undefined) { + this.overwriteNullable("http://www.w3.org/ns/solid/terms#colorizeByAuthor", value, TermMapping.stringToLiteral); + } + get expandImagesInline(): boolean | undefined { + return this.singularNullable("http://www.w3.org/ns/solid/terms#expandImagesInline", ValueMapping.literalToString); + } + set expandImagesInline(value: boolean | undefined) { + this.overwriteNullable("http://www.w3.org/ns/solid/terms#expandImagesInline", value, TermMapping.stringToLiteral); + } + get inlineImageHeight(): number | undefined { + return this.singularNullable("http://www.w3.org/ns/solid/terms#inlineImageHeightEms", ValueMapping.literalToNumber); + } + set inlineImageHeight(value: number | undefined) { + this.overwriteNullable("http://www.w3.org/ns/solid/terms#inlineImageHeightEms", value, TermMapping.numberToLiteral); + } + get newestFirst(): boolean | undefined { + return this.singularNullable("http://www.w3.org/ns/solid/terms#newestFirst", ValueMapping.literalToString); + } + set newestFirst(value: boolean | undefined) { + this.overwriteNullable("http://www.w3.org/ns/solid/terms#newestFirst", value, TermMapping.stringToLiteral); + } + get backgroundColor(): string | undefined { + return this.singularNullable("http://www.w3.org/ns/ui#backgroundColor", ValueMapping.literalToString); + } + set backgroundColor(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/ns/ui#backgroundColor", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/PersonalName.ts b/src/solid/PersonalName.ts new file mode 100644 index 0000000..3e3d936 --- /dev/null +++ b/src/solid/PersonalName.ts @@ -0,0 +1,35 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class PersonalName extends TermWrapper { + + get familyName(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#family-name", ValueMapping.literalToString); + } + set familyName(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#family-name", value, TermMapping.stringToLiteral); + } + get givenName(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#given-name", ValueMapping.literalToString); + } + set givenName(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#given-name", value, TermMapping.stringToLiteral); + } + get additionalName(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#additional-name", ValueMapping.literalToString); + } + set additionalName(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#additional-name", value, TermMapping.stringToLiteral); + } + get honorificPrefix(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#honorific-prefix", ValueMapping.literalToString); + } + set honorificPrefix(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#honorific-prefix", value, TermMapping.stringToLiteral); + } + get honorificSuffix(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#honorific-suffix", ValueMapping.literalToString); + } + set honorificSuffix(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#honorific-suffix", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/PropertyListItem.ts b/src/solid/PropertyListItem.ts new file mode 100644 index 0000000..77e22c8 --- /dev/null +++ b/src/solid/PropertyListItem.ts @@ -0,0 +1,11 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class PropertyListItem extends TermWrapper { + + get propertyName(): string { + return this.singular("http://www.w3.org/2000/01/rdf-schema#label", ValueMapping.literalToString); + } + set propertyName(value: string) { + this.overwrite("http://www.w3.org/2000/01/rdf-schema#label", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/Resource.ts b/src/solid/Resource.ts index 1e62442..7f71533 100644 --- a/src/solid/Resource.ts +++ b/src/solid/Resource.ts @@ -1,96 +1,38 @@ -import { TermMappings, ValueMappings, TermWrapper } from "rdfjs-wrapper" -import { DC, POSIX, RDF, RDFS } from "../vocabulary/mod.js" - -// TODO: review implementation of this -export type FileType = "folder" | "file" | "image" | "document" | "other"; +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; export class Resource extends TermWrapper { - #ianaMediaTypePattern = /^http:\/\/www\.w3\.org\/ns\/iana\/media-types\/(.+)#Resource$/; - - get id(): string { - return this.term.value - } - - get isContainer(): boolean { - return this.id.endsWith("/") - } - - get fileType(): FileType { - return this.isContainer ? "folder" : "file" - } - - get title(): string | undefined { - return this.singularNullable(DC.title, ValueMappings.literalToString) - } - - get label(): string | undefined { - return this.singularNullable(RDFS.label, ValueMappings.literalToString) - } - - get name(): string { - return this.title ?? this.label ?? this.extractNameFromUrl(this.id) - } - - get modified(): Date | undefined { - return this.singularNullable(DC.modified, ValueMappings.literalToDate) - } - - get mtime(): Date | undefined { - return this.singularNullable(POSIX.mtime, ValueMappings.literalToDate) - } - - get lastModified(): Date | undefined { - return this.modified ?? this.mtime - } - - get size(): number | undefined { - return this.singularNullable(POSIX.size, ValueMappings.literalToNumber) - } - - get type(): Set { - return this.objects(RDF.type, ValueMappings.iriToString, TermMappings.stringToIri) - } - - get mimeType(): string | undefined { - const matches = [...this.type] - .map(t => this.#ianaMediaTypePattern.exec(t)) - .filter(results => results !== null) - .map(results => results[0]) - - for (const match of matches) { - return match - } - - return; - } - - override toString() { - return this.id - } - - // TODO: review implementation of this - private extractNameFromUrl(url: string): string { - try { - const urlObj = new URL(url); - const pathParts = urlObj.pathname.split("/").filter(Boolean); - let name = pathParts[pathParts.length - 1] || urlObj.hostname; - - try { - name = decodeURIComponent(name); - } catch (e) { - // Keep original name if decoding fails - } - return name; - } catch (e) { - // If URL parsing fails, try to extract from the string directly - const parts = url.split("/").filter(Boolean); - const lastPart = parts[parts.length - 1] || url; - try { - return decodeURIComponent(lastPart); - } catch { - return lastPart; - } - } - } + get title(): string | undefined { + return this.singularNullable("http://purl.org/dc/elements/1.1/title", ValueMapping.literalToString); + } + set title(value: string | undefined) { + this.overwriteNullable("http://purl.org/dc/elements/1.1/title", value, TermMapping.stringToLiteral); + } + get label(): string | undefined { + return this.singularNullable("http://www.w3.org/2000/01/rdf-schema#label", ValueMapping.literalToString); + } + set label(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2000/01/rdf-schema#label", value, TermMapping.stringToLiteral); + } + get modified(): Date | undefined { + return this.singularNullable("http://purl.org/dc/elements/1.1/modified", ValueMapping.literalToDate); + } + set modified(value: Date | undefined) { + this.overwriteNullable("http://purl.org/dc/elements/1.1/modified", value, TermMapping.dateToLiteral); + } + get mtime(): Date | undefined { + return this.singularNullable("http://www.w3.org/ns/posix/stat#mtime", ValueMapping.literalToDate); + } + set mtime(value: Date | undefined) { + this.overwriteNullable("http://www.w3.org/ns/posix/stat#mtime", value, TermMapping.dateToLiteral); + } + get size(): number | undefined { + return this.singularNullable("http://www.w3.org/ns/posix/stat#size", ValueMapping.literalToNumber); + } + set size(value: number | undefined) { + this.overwriteNullable("http://www.w3.org/ns/posix/stat#size", value, TermMapping.numberToLiteral); + } + get type(): Set { + return this.objects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString, TermMapping.stringToLiteral); + } } diff --git a/src/solid/ScheduleEvent.ts b/src/solid/ScheduleEvent.ts new file mode 100644 index 0000000..28cbf69 --- /dev/null +++ b/src/solid/ScheduleEvent.ts @@ -0,0 +1,26 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class ScheduleEvent extends TermWrapper { + + get Title(): Set { + return this.objects("http://www.w3.org/2002/12/cal/ical#summary", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get location(): Set { + return this.objects("http://www.w3.org/2002/12/cal/ical#location", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get isAllDayEvent(): boolean | undefined { + return this.singularNullable("http://www.w3.org/ns/pim/schedule#allDay", ValueMapping.literalToString); + } + set isAllDayEvent(value: boolean | undefined) { + this.overwriteNullable("http://www.w3.org/ns/pim/schedule#allDay", value, TermMapping.stringToLiteral); + } + get durationDays(): Set { + return this.objects("http://www.w3.org/ns/pim/schedule#durationInDays", ValueMapping.literalToNumber, TermMapping.numberToLiteral); + } + get durationMinutes(): Set { + return this.objects("http://www.w3.org/ns/pim/schedule#durationInMinutes", ValueMapping.literalToNumber, TermMapping.numberToLiteral); + } + get comment(): Set { + return this.objects("http://www.w3.org/2002/12/cal/ical#comment", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/ScheduleEventSoftwareAgent.ts b/src/solid/ScheduleEventSoftwareAgent.ts new file mode 100644 index 0000000..c5a68c0 --- /dev/null +++ b/src/solid/ScheduleEventSoftwareAgent.ts @@ -0,0 +1,5 @@ +import { ValueMapping, TermMapping, TermWrapper, ObjectMapping } from "rdfjs-wrapper"; + +export class ScheduleEventSoftwareAgent extends TermWrapper { + +} \ No newline at end of file diff --git a/src/solid/Telephone.ts b/src/solid/Telephone.ts index ea52d3a..ba5143b 100644 --- a/src/solid/Telephone.ts +++ b/src/solid/Telephone.ts @@ -1,20 +1,17 @@ -import { TermWrapper, ValueMappings, TermMappings } from 'rdfjs-wrapper'; -import { VCARD } from '../vocabulary/mod.js'; +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; export class Telephone extends TermWrapper { - get phoneNumber(): string { - return this.singular(VCARD.hasValue, ValueMappings.literalToString); - } - set phoneNumber(value: string) { - this.overwrite(VCARD.hasValue, value, TermMappings.stringToLiteral); + get telephoneType(): string | undefined { + return this.singularNullable("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString); } - - get phoneType(): string | undefined { - return this.singularNullable(VCARD.telephoneType, ValueMappings.iriToString); + set telephoneType(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", value, TermMapping.stringToLiteral); } - - set phoneType(value: string | undefined) { - this.overwriteNullable(VCARD.telephoneType, value, TermMappings.stringToIri); + get telephoneNumber(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#value", ValueMapping.literalToString); + } + set telephoneNumber(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#value", value, TermMapping.stringToLiteral); } } diff --git a/src/solid/TelephoneAsIRI.ts b/src/solid/TelephoneAsIRI.ts new file mode 100644 index 0000000..30b93f3 --- /dev/null +++ b/src/solid/TelephoneAsIRI.ts @@ -0,0 +1,11 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class TelephoneAsIRI extends TermWrapper { + + get telephoneNumber(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#value", ValueMapping.literalToString); + } + set telephoneNumber(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#value", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/VCard.ts b/src/solid/VCard.ts new file mode 100644 index 0000000..e5383e8 --- /dev/null +++ b/src/solid/VCard.ts @@ -0,0 +1,25 @@ +import { TermWrapper, ValueMapping, TermMapping, ObjectMapping } from "rdfjs-wrapper"; +import { VCardAddress } from './VCardAddress.js'; +import { VCardPersonalName } from './VCardPersonalName.js'; + +export class VCard extends TermWrapper { + + get fullName(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#fn", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get name(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#n", ObjectMapping.as(VCardPersonalName), ObjectMapping.as(VCardPersonalName)); + } + get email(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasEmail", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get telephone(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasTelephone", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get address(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#hasAddress", ObjectMapping.as(VCardAddress), ObjectMapping.as(VCardAddress)); + } + get organizationName(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#organization-name", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/VCardAddress.ts b/src/solid/VCardAddress.ts new file mode 100644 index 0000000..81ad03a --- /dev/null +++ b/src/solid/VCardAddress.ts @@ -0,0 +1,23 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class VCardAddress extends TermWrapper { + + get streetAddress(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#street-address", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get extendedAddress(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#extended-address", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get locality(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#locality", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get region(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#region", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get postalCode(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#postal-code", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get countryName(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#country-name", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/VCardPersonalName.ts b/src/solid/VCardPersonalName.ts new file mode 100644 index 0000000..4a26e84 --- /dev/null +++ b/src/solid/VCardPersonalName.ts @@ -0,0 +1,20 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class VCardPersonalName extends TermWrapper { + + get familyName(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#family-name", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get givenName(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#given-name", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get additionalName(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#additional-name", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get honorificPrefix(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#honorific-prefix", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get honorificSuffix(): Set { + return this.objects("http://www.w3.org/2006/vcard/ns#honorific-suffix", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/WebId.ts b/src/solid/WebId.ts new file mode 100644 index 0000000..4b691e6 --- /dev/null +++ b/src/solid/WebId.ts @@ -0,0 +1,17 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class WebId extends TermWrapper { + + get webIdType(): string { + return this.singular("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", ValueMapping.literalToString); + } + set webIdType(value: string) { + this.overwrite("http://www.w3.org/1999/02/22-rdf-syntax-ns#type", value, TermMapping.stringToLiteral); + } + get webIdValue(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#value", ValueMapping.literalToString); + } + set webIdValue(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#value", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/WebIdAgent.ts b/src/solid/WebIdAgent.ts new file mode 100644 index 0000000..aae6178 --- /dev/null +++ b/src/solid/WebIdAgent.ts @@ -0,0 +1,86 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class WebIdAgent extends TermWrapper { + + get vcardFn(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#fn", ValueMapping.literalToString); + } + set vcardFn(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#fn", value, TermMapping.stringToLiteral); + } + get vcardHasUrl(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#hasUrl", ValueMapping.literalToString); + } + set vcardHasUrl(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#hasUrl", value, TermMapping.stringToLiteral); + } + get organization(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#organizationName", ValueMapping.literalToString); + } + set organization(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#organizationName", value, TermMapping.stringToLiteral); + } + get role(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#role", ValueMapping.literalToString); + } + set role(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#role", value, TermMapping.stringToLiteral); + } + get title(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#title", ValueMapping.literalToString); + } + set title(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#title", value, TermMapping.stringToLiteral); + } + get hasTelephone(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#hasTelephone", ValueMapping.literalToString); + } + set hasTelephone(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#hasTelephone", value, TermMapping.stringToLiteral); + } + get foafName(): string | undefined { + return this.singularNullable("http://xmlns.com/foaf/0.1/name", ValueMapping.literalToString); + } + set foafName(value: string | undefined) { + this.overwriteNullable("http://xmlns.com/foaf/0.1/name", value, TermMapping.stringToLiteral); + } + get name(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#hasName", ValueMapping.literalToString); + } + set name(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#hasName", value, TermMapping.stringToLiteral); + } + get foafHomepage(): string | undefined { + return this.singularNullable("http://xmlns.com/foaf/0.1/homepage", ValueMapping.literalToString); + } + set foafHomepage(value: string | undefined) { + this.overwriteNullable("http://xmlns.com/foaf/0.1/homepage", value, TermMapping.stringToLiteral); + } + get photoUrl(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#hasPhoto", ValueMapping.literalToString); + } + set photoUrl(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#hasPhoto", value, TermMapping.stringToLiteral); + } + get hasEmail(): string | undefined { + return this.singularNullable("http://www.w3.org/2006/vcard/ns#hasEmail", ValueMapping.literalToString); + } + set hasEmail(value: string | undefined) { + this.overwriteNullable("http://www.w3.org/2006/vcard/ns#hasEmail", value, TermMapping.stringToLiteral); + } + get inAddressBook(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#inAddressBook", ValueMapping.literalToString); + } + set inAddressBook(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#inAddressBook", value, TermMapping.stringToLiteral); + } + get pimStorage(): Set { + return this.objects("http://www.w3.org/ns/pim/space#storage", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get solidStorage(): Set { + return this.objects("https://www.w3.org/ns/solid/terms#storage", ValueMapping.literalToString, TermMapping.stringToLiteral); + } + get knows(): Set { + return this.objects("http://xmlns.com/foaf/0.1/knows", ValueMapping.literalToString, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/WebPage.ts b/src/solid/WebPage.ts new file mode 100644 index 0000000..2c80bc8 --- /dev/null +++ b/src/solid/WebPage.ts @@ -0,0 +1,11 @@ +import { TermWrapper, ValueMapping, TermMapping } from "rdfjs-wrapper"; + +export class WebPage extends TermWrapper { + + get url(): string { + return this.singular("http://www.w3.org/2006/vcard/ns#value", ValueMapping.literalToString); + } + set url(value: string) { + this.overwrite("http://www.w3.org/2006/vcard/ns#value", value, TermMapping.stringToLiteral); + } +} diff --git a/src/solid/index.ts b/src/solid/index.ts new file mode 100644 index 0000000..75d47f2 --- /dev/null +++ b/src/solid/index.ts @@ -0,0 +1,40 @@ +export * from "./AccessControlResource"; // AccessControlResource +export * from "./AcpAccessControl"; // AcpAccessControl +export * from "./AcpMatcher"; // AcpMatcher +export * from "./AccessControlPolicy"; // AccessControlPolicy +export * from "./AccessControlPolicy"; // AccessControlPolicy +export * from "./AddressBook"; // AddressBook +export * from "./Address"; // Address +export * from "./Agent"; // Agent +export * from "./WebIdAgent"; // WebIdAgent +export * from "./Bookmark"; // Bookmark +export * from "./ChatChannel"; // ChatChannel +export * from "./ChatSharedPreferences"; // ChatSharedPreferences +export * from "./Participation"; // Participation +export * from "./ChatMessage"; // ChatMessage +export * from "./ChatAction"; // ChatAction +export * from "./Container"; // Container +export * from "./Email"; // Email +export * from "./EmailWithType"; // EmailWithType +export * from "./ScheduleEvent"; // ScheduleEvent +export * from "./Group"; // Group +export * from "./GroupMemberLocalId"; // GroupMemberLocalId +export * from "./IssueTrackerAssigneeGroup"; // IssueTrackerAssigneeGroup +export * from "./IssueTracker"; // IssueTracker +export * from "./PropertyListItem"; // PropertyListItem +export * from "./Meeting"; // Meeting +export * from "./ContactOrganization"; // ContactOrganization +export * from "./ContactDetailsOrganization"; // ContactDetailsOrganization +export * from "./ContactDetailsPerson"; // ContactDetailsPerson +export * from "./IssueTrackerPerson"; // IssueTrackerPerson +export * from "./ContactPerson"; // ContactPerson +export * from "./PersonalName"; // PersonalName +export * from "./Resource"; // Resource +export * from "./ScheduleEventSoftwareAgent"; // ScheduleEventSoftwareAgent +export * from "./TelephoneAsIRI"; // TelephoneAsIRI +export * from "./Telephone"; // Telephone +export * from "./VCard"; // VCard +export * from "./VCardPersonalName"; // VCardPersonalName +export * from "./VCardAddress"; // VCardAddress +export * from "./WebId"; // WebId +export * from "./WebPage"; // WebPage \ No newline at end of file