Options
All
  • Public
  • Public/Protected
  • All
Menu

bubblegum-mutuality-reader

Index

Type aliases

FileFetcher

FileFetcher: function

Type declaration

    • (filePath: string): Promise<string>
    • Parameters

      • filePath: string

      Returns Promise<string>

ReleaseFetcher

ReleaseFetcher: function

Type declaration

    • (release: Release): Promise<string>
    • Parameters

      Returns Promise<string>

ReleaseFilter

ReleaseFilter: function

Type declaration

    • Parameters

      Returns boolean

Variables

Const ccAttributionName

ccAttributionName: "http://creativecommons.org/ns#attributionName" = "http://creativecommons.org/ns#attributionName"

Const ccAttributionURL

ccAttributionURL: "http://creativecommons.org/ns#attributionURL" = "http://creativecommons.org/ns#attributionURL"

Const dcLanguage

dcLanguage: "http://purl.org/dc/elements/1.1/language" = "http://purl.org/dc/elements/1.1/language"

Const dctermsAudience

dctermsAudience: "http://purl.org/dc/terms/audience" = "http://purl.org/dc/terms/audience"

Const dctermsCreated

dctermsCreated: "http://purl.org/dc/terms/created" = "http://purl.org/dc/terms/created"

Const dctermsDescription

dctermsDescription: "http://dublincore.org/documents/2012/06/14/dcmi-terms/description" = "http://dublincore.org/documents/2012/06/14/dcmi-terms/description"

Const dctermsLicense

dctermsLicense: "http://purl.org/dc/terms/license" = "http://purl.org/dc/terms/license"

Const dctermsRequires

dctermsRequires: "http://purl.org/dc/terms/requires" = "http://purl.org/dc/terms/requires"

Const dctermsSubject

dctermsSubject: "http://purl.org/dc/terms/subject" = "http://purl.org/dc/terms/subject"

Const dctermsTitle

dctermsTitle: "http://purl.org/dc/terms/title" = "http://purl.org/dc/terms/title"

Const doapHomepage

doapHomepage: "http://usefulinc.com/ns/doap#homepage" = "http://usefulinc.com/ns/doap#homepage"

Const doapMaintainer

doapMaintainer: "http://usefulinc.com/ns/doap#maintainer" = "http://usefulinc.com/ns/doap#maintainer"

Const doapRelease

doapRelease: "http://usefulinc.com/ns/doap#release" = "http://usefulinc.com/ns/doap#release"

Const doapRepoLocation

doapRepoLocation: "http://usefulinc.com/ns/doap#location" = "http://usefulinc.com/ns/doap#location"

Const doapRevision

doapRevision: "http://usefulinc.com/ns/doap#revision" = "http://usefulinc.com/ns/doap#revision"

Const doapShortDesc

doapShortDesc: "http://usefulinc.com/ns/doap#shortdesc" = "http://usefulinc.com/ns/doap#shortdesc"

Const dump1

dump1: "<http://a.com/a> <http://purl.org/dc/terms/title> "dump1" ." = "<http://a.com/a> <http://purl.org/dc/terms/title> "dump1" ."

Const dump2

dump2: "<http://a.com/a> <http://purl.org/dc/terms/title> "dump2" ." = "<http://a.com/a> <http://purl.org/dc/terms/title> "dump2" ."

Const foafCurrentProject

foafCurrentProject: "http://xmlns.com/foaf/0.1/currentProject" = "http://xmlns.com/foaf/0.1/currentProject"

Const foafHomepage

foafHomepage: "http://xmlns.com/foaf/0.1/homepage" = "http://xmlns.com/foaf/0.1/homepage"

Const foafNickname

foafNickname: "http://xmlns.com/foaf/0.1/nick" = "http://xmlns.com/foaf/0.1/nick"

Const mutualityContent

mutualityContent: string = ['<http://one.example/subject1> <http://dublincore.org/documents/2012/06/14/dcmi-terms/description> "some desc"@en .','<http://one.example/subject1> <http://purl.org/dc/terms/title> "some title"@en .','<http://one.example/subject1> <http://usefulinc.com/ns/doap#shortdesc> "short desc"@en .','<http://one.example/subject1> <http://purl.org/dc/elements/1.1/language> "en-GB" .','<http://one.example/subject1> <http://usefulinc.com/ns/doap#homepage> "http://site.com" .','<http://one.example/subject1> <http://purl.org/dc/terms/license> <http://creativecommons.org/licenses/by-nc/3.0/> .','<http://one.example/subject1> <http://creativecommons.org/ns#attributionName> "attr name"@en .','<http://one.example/subject1> <http://creativecommons.org/ns#attributionURL> "http://site.com/attribution" .','<http://one.example/subject1> <http://usefulinc.com/ns/doap#location> "https://github.com/ewilderj/doap.git" .','<http://one.example/subject1> <http://purl.org/dc/terms/created> "2008-09-15T15:53:00+05:00" .','<http://one.example/subject1> <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Computer_science> .','<http://one.example/subject1> <http://usefulinc.com/ns/doap#release> <http://one.example/release1> .','<http://one.example/subject1> <http://usefulinc.com/ns/doap#release> <http://one.example/release2> .','<http://one.example/subject1> <http://rdfs.org/ns/void#vocabulary> "http://purl.org/dc/terms/" .','<http://one.example/subject1> <http://rdfs.org/ns/void#vocabulary> "http://rdfs.org/sioc/ns" .','<http://one.example/subject1> <http://rdfs.org/ns/void#uriSpace> "http://one.example/" .','<http://one.example/subject1> <http://purl.org/dc/terms/requires> <http://one.example/dep1> .','<http://one.example/subject1> <http://usefulinc.com/ns/doap#maintainer> <http://one.example/maintainer1> .','<http://one.example/subject1> <http://xmlns.com/foaf/0.1/currentProject> "http://one.example/monsters" .','<http://one.example/subject1> <http://xmlns.com/foaf/0.1/currentProject> "http://one.example/heros" .','<http://one.example/release1> <http://purl.org/dc/terms/created> "2008-09-15T15:53:00+05:00" .','<http://one.example/release1> <http://rdfs.org/ns/void#dataDump> "http://site.com/dump.n3.gz" .','<http://one.example/release1> <http://purl.org/dc/elements/1.1/language> "en-GB" .','<http://one.example/release1> <http://rdfs.org/ns/void#feature> <http://www.w3.org/ns/formats/N-Triples> .','<http://one.example/release1> <http://usefulinc.com/ns/doap#revision> "1.0".','<http://one.example/release1> <http://rdfs.org/ns/void#uriSpace> "http://site.com/release1/en" .','<http://one.example/release1> <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Computer_science> .','<http://one.example/release2> <http://purl.org/dc/terms/created> "2008-09-15T15:53:00+05:00" .','<http://one.example/release2> <http://rdfs.org/ns/void#dataDump> "http://site.com/dump2.n3.gz" .','<http://one.example/release2> <http://rdfs.org/ns/void#feature> <http://www.w3.org/ns/formats/N3> .','<http://one.example/release2> <http://usefulinc.com/ns/doap#revision> "2.0".','<http://one.example/release2> <http://purl.org/dc/elements/1.1/language> "en-GB".','<http://one.example/release2> <http://rdfs.org/ns/void#uriSpace> <http://site.com/release2/en> .','<http://one.example/release2> <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Computer_science> .','<http://one.example/release2> <http://purl.org/dc/terms/audience> <http://site.com/all-ages-uk> .','<http://one.example/dep1> <http://purl.org/dc/terms/created> "2008-09-15T15:53:00+05:00".','<http://one.example/dep1> <http://rdfs.org/ns/void#dataDump> "http://site.com/dump.n3.gz".','<http://one.example/dep1> <http://rdfs.org/ns/void#feature> <http://www.w3.org/ns/formats/Turtle> .','<http://one.example/dep1> <http://usefulinc.com/ns/doap#revision> "1.0".','<http://one.example/dep1> <http://purl.org/dc/elements/1.1/language> "en-GB".','<http://one.example/dep1> <http://rdfs.org/ns/void#uriSpace> <http://site.com/space1> .','<http://one.example/dep1> <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Computer_science> .','<http://one.example/dep1> <http://purl.org/dc/terms/audience> <http://site.com/all-ages-uk> .','<http://one.example/dep1> <http://purl.org/dc/terms/audience> <http://site.com/all-ages-us> .','<http://one.example/maintainer1> <http://xmlns.com/foaf/0.1/homepage> <http://one.example/oli/profile> .','<http://one.example/maintainer1> <http://xmlns.com/foaf/0.1/nick> "Oli" .','<http://one.example/maintainer1> <http://xmlns.com/foaf/0.1/currentProject> "http://one.example/monsters" .'].join('\n')

Const voidDataDump

voidDataDump: "http://rdfs.org/ns/void#dataDump" = "http://rdfs.org/ns/void#dataDump"

Const voidFeature

voidFeature: "http://rdfs.org/ns/void#feature" = "http://rdfs.org/ns/void#feature"

Const voidUriSpace

voidUriSpace: "http://rdfs.org/ns/void#uriSpace" = "http://rdfs.org/ns/void#uriSpace"

Const voidVocabulary

voidVocabulary: "http://rdfs.org/ns/void#vocabulary" = "http://rdfs.org/ns/void#vocabulary"

Functions

Const asFeature

byAudience

  • Filter a list of releases or dependencies by audience

    Example

    dependencies.filter(byAudience('http://dbpedia.org/resource/Adults'))
    // => dependencies
    

    Parameters

    • audience: string

      a specific audience

    Returns ReleaseFilter

    releases

bySubjects

  • Filter a list of releases or dependencies by subjects

    Example

    dependencies.filter(bySubjects(['http://dbpedia.org/resource/Paris']))
    // => dependencies
    

    Parameters

    • subjects: ReadonlyArray<string>

      a list of subjects

    Returns ReleaseFilter

    releases

fetchDependencies

  • fetchDependencies(releaseFetcher: ReleaseFetcher, dependencies: ReadonlyArray<Release>): Promise<ReadonlyArray<Triple>>
  • Fetch a list of dependencies

    Parameters

    • releaseFetcher: ReleaseFetcher

      a downloader for the content

    • dependencies: ReadonlyArray<Release>

      the list of releases to download

    Returns Promise<ReadonlyArray<Triple>>

    a list of triples

fetchDependency

  • Fetch a dependency

    Parameters

    • releaseFetcher: ReleaseFetcher

      a downloader for the content

    • dependency: Release

      the release to download

    Returns Promise<ReadonlyArray<Triple>>

    a list of triples

fetchTriplesByPath

  • fetchTriplesByPath(fileFetcher: FileFetcher, path: string): Promise<ReadonlyArray<Triple>>
  • Fetch triples by a path or uri

    Parameters

    • fileFetcher: FileFetcher

      a downloader for the file

    • path: string

      the file path or uri for the file

    Returns Promise<ReadonlyArray<Triple>>

    a list of triples

fetchTriplesByPaths

  • fetchTriplesByPaths(fileFetcher: FileFetcher, paths: ReadonlyArray<string>): Promise<ReadonlyArray<Triple>>
  • Fetch triples by a list of paths or uris

    Parameters

    • fileFetcher: FileFetcher

      a downloader for the file

    • paths: ReadonlyArray<string>

      the list of paths

    Returns Promise<ReadonlyArray<Triple>>

    a list of triples

Const mockFileFetcher

  • mockFileFetcher(path: string): Promise<string>

Const mockReleaseFetcher

  • mockReleaseFetcher(release: Release): Promise<string>

Const nullToEmpty

  • nullToEmpty(value: string | null): string

parseMaintainer

  • parseMaintainer(triples: ReadonlyArray<Triple>, identifier: string, access: ReadonlyArray<string>): AgentAccess

parseMutuality

  • parseMutuality(language: string, content: string): Mutuality
  • Parses a mutuality content provided as n-triples

    Example

    parseMutuality('en', ntripleStringContent)
    // => Mutuality object
    

    Parameters

    • language: string

      the language for all the descriptions

    • content: string

      the content in the n-triples format

    Returns Mutuality

    a Mutuality object

parseRelease

  • parseRelease(triples: ReadonlyArray<Triple>, identifier: string): Release

Object literals

Const dependency1

dependency1: object

audiences

audiences: string[] = ['http://site.com/all-ages-uk', 'http://site.com/all-ages-us']

created

created: string = "2008-09-15T15:53:00+05:00"

dataDump

dataDump: string = "http://site.com/dump1.nt"

feature

feature: NTriples = DependencyFeature.NTriples

identifier

identifier: string = "http://one.example/dep1"

language

language: string = "en-GB"

revision

revision: string = "1.0"

subjects

subjects: string[] = ['http://dbpedia.org/resource/Computer_science']

uriSpace

uriSpace: string = "http://site.com/space1"

Const dependency2

dependency2: object

audiences

audiences: string[] = ['http://site.com/all-ages-uk']

created

created: string = "2008-09-15T15:53:00+05:00"

dataDump

dataDump: string = "http://site.com/dump2.nt"

feature

feature: NTriples = DependencyFeature.NTriples

identifier

identifier: string = "http://one.example/dep2"

language

language: string = "en-GB"

revision

revision: string = "1.0"

subjects

subjects: string[] = ['http://dbpedia.org/resource/Computer_science']

uriSpace

uriSpace: string = "http://site.com/space1"

Const release1

release1: object

audiences

audiences: string[] = ['http://site.com/all-ages-uk', 'http://site.com/all-ages-us']

created

created: string = "2008-09-15T15:53:00+05:00"

dataDump

dataDump: string = "http://site.com/dump.n3.gz"

feature

feature: NTriples = DependencyFeature.NTriples

identifier

identifier: string = "http://one.example/release"

language

language: string = "en-GB"

revision

revision: string = "1.0"

subjects

subjects: string[] = ['http://dbpedia.org/resource/Computer_science','http://dbpedia.org/resource/Technology']

uriSpace

uriSpace: string = "http://site.com/release1/en"

Const release2

release2: object

audiences

audiences: string[] = ['http://site.com/all-ages-us']

created

created: string = "2008-09-15T15:53:00+05:00"

dataDump

dataDump: string = "http://site.com/dump2.n3.gz"

feature

feature: NTriples = DependencyFeature.NTriples

identifier

identifier: string = "http://one.example/release2"

language

language: string = "en-GB"

revision

revision: string = "1.0"

subjects

subjects: string[] = ['http://dbpedia.org/resource/Black_magic']

uriSpace

uriSpace: string = "http://site.com/release2/en"

Const tripleDump1

tripleDump1: object

object

object: string = ""dump1""

predicate

predicate: string = "http://purl.org/dc/terms/title"

subject

subject: string = "http://a.com/a"

Const tripleDump2

tripleDump2: object

object

object: string = ""dump2""

predicate

predicate: string = "http://purl.org/dc/terms/title"

subject

subject: string = "http://a.com/a"

Generated using TypeDoc