| Title: | Create DCAT-AP CH Metadata Files |
|---|---|
| Description: | Create DCAT-AP CH metadata files, typically in rdf format. |
| Authors: | Sandro Burri [aut, cre] |
| Maintainer: | Sandro Burri <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.0.1 |
| Built: | 2026-05-17 06:51:55 UTC |
| Source: | https://github.com/SwissStatsR/dcatapchr |
Adds quotes to a character string
add_quotes(x)add_quotes(x)
x |
a character string (or vector) |
# Add quotes around a character string add_quotes("A character string") # Add quotes around a vector of strings add_quotes(c("a", "b"))# Add quotes around a character string add_quotes("A character string") # Add quotes around a vector of strings add_quotes(c("a", "b"))
Create a dcat:accessService property in DCAT-AP CH standard
dcat_accessService(x = dcat_DataService())dcat_accessService(x = dcat_DataService())
x |
things to include in a dcat:accessService, typically one or more dcat:DataService |
Create a dcat:accessURL property in DCAT-AP CH standard
dcat_accessURL( access_url = "https://www3.ti.ch/DFE/DR/USTAT/allegati/cubo/cubi_POL_01_csv.zip" )dcat_accessURL( access_url = "https://www3.ti.ch/DFE/DR/USTAT/allegati/cubo/cubi_POL_01_csv.zip" )
access_url |
url of the resource Mandatory property of |
dcat_accessURL(access_url = "https://www3.ti.ch/DFE/DR/USTAT/allegati/cubo/cubi_POL_01_csv.zip")dcat_accessURL(access_url = "https://www3.ti.ch/DFE/DR/USTAT/allegati/cubo/cubi_POL_01_csv.zip")
Create a dcat:byteSize property in DCAT-AP CH standard
dcat_byteSize(size = 0)dcat_byteSize(size = 0)
size |
size of the resource (in bytes) Property of |
# Size (in bytes) of a file f <- system.file("cubi_POL_01_INFORMAZIONI.txt", package = "dcatapchr") s <- file.size(f) s # Create a dcat:byteSize tag dcat_byteSize(size = s) # Remove f and s rm(f, s)# Size (in bytes) of a file f <- system.file("cubi_POL_01_INFORMAZIONI.txt", package = "dcatapchr") s <- file.size(f) s # Create a dcat:byteSize tag dcat_byteSize(size = s) # Remove f and s rm(f, s)
Create a DCAT-AP CH Catalog (dcat:Catalog)
dcat_catalog( catalog_endpoint = "https://swisstopo/catalog-endpoint.rdf", datasets = "<dcat:dataset rdf:resource=\"https://swisstopo/123\"/>", ... )dcat_catalog( catalog_endpoint = "https://swisstopo/catalog-endpoint.rdf", datasets = "<dcat:dataset rdf:resource=\"https://swisstopo/123\"/>", ... )
catalog_endpoint |
URL/URI of the catalog endpoint |
datasets |
character vector with one or more dcat:dataset(s), see
|
... |
any other property to be included to a dcat:Catalog |
A dcat:Catalog class, created with dcat_catalog(), can/must have the following properties (M stands for mandatory; R for recommended):
dcat:dataset, M in V1, R in V2: see dcat_dataset()
dct:description, M in V2: see dct_description()
dct:publisher, M in V2: see dct_publisher()
dct:title, M in V2: see dct_title()
foaf:homepage, R in V2: see foaf_homepage()
dct:language, R in V2: see dct_language()
dct:license, R in V2: see dct_license()
dct:issued, R in V2: see dct_issued()
dct:rights, R in V2: see dct_rights()
dct:spatial, R in V2: see dct_spatial()
dcat:themeTaxonomy, R in V2: see dcat_themeTaxonomy()
dct:modified, R in V2: see dct_modified()
dcat:service, R in V2: see dcat_service()
A character vector of length greater than one,
where each element is a line of the catalog in rdf
format. The catalog can be exported in a file with
unix file endings and UTF-8 encoding with
write_unix().
dcat_catalog() dcat_catalog(catalog_endpoint = "") # Add some properties (...) dcat_catalog( title = dct_title("Catalogo Ustat", language = "it"), description = dct_description("Descrizione catalogo", language = "it") )dcat_catalog() dcat_catalog(catalog_endpoint = "") # Add some properties (...) dcat_catalog( title = dct_title("Catalogo Ustat", language = "it"), description = dct_description("Descrizione catalogo", language = "it") )
Create a dcat:contactPoint property in DCAT-AP CH standard
dcat_contactPoint( nodeID = paste(sample(letters), collapse = ""), email = "[email protected]", fn = "Ufficio di statistica del Canton Ticino (Ustat)" )dcat_contactPoint( nodeID = paste(sample(letters), collapse = ""), email = "[email protected]", fn = "Ufficio di statistica del Canton Ticino (Ustat)" )
nodeID |
organization id (character string) |
email |
email address |
fn |
name of the organization Mandatory property of |
# Create a dcat:contactPoint tag dcat_contactPoint( nodeID = "organization_id", email = "[email protected]", fn = "Ufficio di statistica del Canton Ticino (Ustat)" )# Create a dcat:contactPoint tag dcat_contactPoint( nodeID = "organization_id", email = "[email protected]", fn = "Ufficio di statistica del Canton Ticino (Ustat)" )
Create a DCAT-AP CH DataService (dcat:DataService)
dcat_DataService(about = "", endpointURL = dcat_endpointURL(), ...)dcat_DataService(about = "", endpointURL = dcat_endpointURL(), ...)
about |
url of the DataService |
endpointURL |
enpointURL of the dataset, see dcat_endpointURL() |
... |
any other property to be included to a dcat:Dataset |
A dcat:DataService class, created with dcat_DataService(), can/must have the following properties (M stands for mandatory; R for recommended):
dcat:endpointURL, M in V2: see dcat_endpointURL()
dcat:contactPoint, M in V2: see dcat_contactPoint()
dct:publisher, M in V2: see dct_publisher()
dct:title, M in V2: see dct_title()
dct:endpointDescription, R in V2: see dcat_endpointDescription()
dct:license, R in V2: see dct_license() and/or dct_license2()
dcat:servesDataset, R in V2: see dcat_servesDataset()
A character vector of length greater than one.
A dcat:dataset must have one or more dcat:distribution(s).
dcat_dataset( title = dct_title(), description = dct_description(), publisher = dct_publisher(), contactPoint = dcat_contactPoint(), identifier = dct_identifier(), distribution = dcat_distribution(), ... )dcat_dataset( title = dct_title(), description = dct_description(), publisher = dct_publisher(), contactPoint = dcat_contactPoint(), identifier = dct_identifier(), distribution = dcat_distribution(), ... )
title |
title of the dataset, see |
description |
description of the dataset, see |
publisher |
publisher of the dataset, see |
contactPoint |
contactPoint of the dataset, see |
identifier |
identifier of the dataset, see |
distribution |
one or more distributions, see |
... |
any other property to be included to a dcat:Dataset |
A dcat:Dataset class, created with dcat_dataset(), can/must have the following properties (M stands for mandatory; R for recommended):
dcat:contactPoint, M in V1 and V2: see dcat_contactPoint()
dct:description, M in V1 and V2: see dct_description()
dct:identifier, M in V1 and V2: see dct_identifier()
dct:publisher, M in V1 and V2: see dct_publisher()
dct:title, M in V1 and V2: see dct_title()
dcat:distribution, M in V1, R in V2: see dcat_distribution()
dcat:keyword, R in V2: see dcat_keyword()
dcat:landingPage, R in V2: see dcat_landingPage()
dct:issued, R in V2: see dct_issued()
dct:spatial, R in V2: see dct_spatial()
dct:temporal, R in V2: see dct_temporal()
dcat:theme, R in V2: see dcat_theme()
dct:modified, R in V2: see dct_modified()
A character vector of length greater than one.
Create a dcat:distribution/dcat:Distribution property
dcat_distribution( issued = dct_issued(), access_url = dcat_accessURL(), license = dct_license2(), ... )dcat_distribution( issued = dct_issued(), access_url = dcat_accessURL(), license = dct_license2(), ... )
issued |
dct:issued property, see |
access_url |
dcat:accessURL property, see |
license |
dct:license property, see |
... |
any other property to be included to a dcat:Distribution |
A dcat:Dataset class, created with dcat_dataset(), can/must have the following properties (M stands for mandatory; R for recommended):
dct:issued, M in V1, R in V2: see dct_issued()
dcat:accessURL, M in V1 and V2: see dcat_accessURL()
dct:license, M in V1 and V2: see dct_license()
dcatap:availability, R in V2: not yet implemented
dct:description, R in V1 and V2: see dct_description()
dct:format, R in V2: see dct_format()
dct:rights, R in V2: see dct_rights()
dct:title, M in V1, R in V2: see dct_title()
dct:modified, R in V2: see dct_modified()
dcat:accessService, R in V2: see dcat_accessService()
A character vector of length greater than one.
dcat_distribution() dcat_distribution(description = dct_description("Un archivio zip con un csv"))dcat_distribution() dcat_distribution(description = dct_description("Un archivio zip con un csv"))
Property of dcat:Distribution (dcat_distribution())
dcat_downloadURL( download_url = "https://www3.ti.ch/DFE/DR/USTAT/allegati/cubo/cubi_POL_01_csv.zip" )dcat_downloadURL( download_url = "https://www3.ti.ch/DFE/DR/USTAT/allegati/cubo/cubi_POL_01_csv.zip" )
download_url |
url of the resource |
dcat_downloadURL( download_url = "https://www3.ti.ch/DFE/DR/USTAT/allegati/cubo/cubi_POL_01_csv.zip" )dcat_downloadURL( download_url = "https://www3.ti.ch/DFE/DR/USTAT/allegati/cubo/cubi_POL_01_csv.zip" )
Create a dcat:endpointDescription property in DCAT-AP CH standard
dcat_endpointDescription(x = "")dcat_endpointDescription(x = "")
x |
a url |
Create a dcat:endpointURL property in DCAT-AP CH standard
dcat_endpointURL(x = "")dcat_endpointURL(x = "")
x |
a url |
Create a dcat:keyword property in DCAT-AP CH standard
dcat_keyword(x = "", language = c("de", "fr", "it", "en"))dcat_keyword(x = "", language = c("de", "fr", "it", "en"))
x |
keyword |
language |
one of "de", "fr", "it" or "en" |
dcat_keyword() dcat_keyword("Cani", language = "it") dcat_keyword("Hunde", language = "de")dcat_keyword() dcat_keyword("Cani", language = "it") dcat_keyword("Hunde", language = "de")
Create a dcat:landingPage property in DCAT-AP CH standard
dcat_landingPage(x = "https://www.example.com")dcat_landingPage(x = "https://www.example.com")
x |
an url (character string). Default: https://www.example.com |
dcat_landingPage()dcat_landingPage()
Property of dcat:Distribution (dcat_distribution()).
See also https://handbook.opendata.swiss/fr/content/glossar/bibliothek/dcat-ap-ch.html#dcat-distribution-media-type
dcat_mediaType( media_type = "https://www.iana.org/assignments/media-types/text/csv" )dcat_mediaType( media_type = "https://www.iana.org/assignments/media-types/text/csv" )
media_type |
a MIME type of IANA-MEDIA-TYPES. Example: "https://www.iana.org/assignments/media-types/text/csv" |
dcat_mediaType()dcat_mediaType()
Create a dcat:servesDataset property in DCAT-AP CH standard
dcat_servesDataset(x = "https://example.com")dcat_servesDataset(x = "https://example.com")
x |
a url |
dcat_servesDataset("https://example.com")dcat_servesDataset("https://example.com")
Create a dcat:service property in DCAT-AP CH standard
dcat_service(x = "")dcat_service(x = "")
x |
things to include in a dcat:service, typically one or more dcat:DataService |
Create a dcat:theme property in DCAT-AP CH standard
dcat_theme(x = "http://dcat-ap.ch/vocabulary/themes/work")dcat_theme(x = "http://dcat-ap.ch/vocabulary/themes/work")
x |
a theme url |
dcat_theme(x = "http://dcat-ap.ch/vocabulary/themes/work")dcat_theme(x = "http://dcat-ap.ch/vocabulary/themes/work")
Create a dcat:themeTaxonomy property in DCAT-AP CH standard
dcat_themeTaxonomy( x = "http://publications.europa.eu/resource/authority/data-theme" )dcat_themeTaxonomy( x = "http://publications.europa.eu/resource/authority/data-theme" )
x |
an url |
dcat_themeTaxonomy(x = "http://publications.europa.eu/resource/authority/data-theme")dcat_themeTaxonomy(x = "http://publications.europa.eu/resource/authority/data-theme")
Create a dct:accrualPeriodicity property in DCAT-AP CH standard
dct_accrualPeriodicity( freq = c("https://publications.europa.eu/resource/authority/frequency/ANNUAL", "https://publications.europa.eu/resource/authority/frequency/QUARTERLY", "https://publications.europa.eu/resource/authority/frequency/MONTHLY", "https://publications.europa.eu/resource/authority/frequency/DAILY") )dct_accrualPeriodicity( freq = c("https://publications.europa.eu/resource/authority/frequency/ANNUAL", "https://publications.europa.eu/resource/authority/frequency/QUARTERLY", "https://publications.europa.eu/resource/authority/frequency/MONTHLY", "https://publications.europa.eu/resource/authority/frequency/DAILY") )
freq |
frequency with which a dataset is updated (see https://publications.europa.eu/resource/authority/frequency) |
dct_accrualPeriodicity( freq = "https://publications.europa.eu/resource/authority/frequency/ANNUAL" )dct_accrualPeriodicity( freq = "https://publications.europa.eu/resource/authority/frequency/ANNUAL" )
Create a dct:description property in DCAT-AP CH standard
dct_description(description = "", language = "it")dct_description(description = "", language = "it")
description |
character string with a description |
language |
language of the title (one of "it", "de", "fr", "en") |
tmp <- paste0( "This is a description of a certain ", "distribution of a dataset" ) dct_description(description = tmp, language = "en") rm(tmp)tmp <- paste0( "This is a description of a certain ", "distribution of a dataset" ) dct_description(description = tmp, language = "en") rm(tmp)
Create a dct:format property in DCAT-AP CH standard
dct_format( x = "http://publications.europa.eu/resource/authority/file-type/CSV" )dct_format( x = "http://publications.europa.eu/resource/authority/file-type/CSV" )
x |
a filetype resource url/uri. See https://publications.europa.eu/resource/authority/file-type |
dct_format( x = "http://publications.europa.eu/resource/authority/file-type/CSV" )dct_format( x = "http://publications.europa.eu/resource/authority/file-type/CSV" )
Create a dct:identifier property in DCAT-AP CH standard
dct_identifier(identifier = "xyz456@cantone_ticino")dct_identifier(identifier = "xyz456@cantone_ticino")
identifier |
character string with and identifier |
dct_identifier(identifier = "ti-ustat-cubi_pol_01@ustat")dct_identifier(identifier = "ti-ustat-cubi_pol_01@ustat")
Create a dct:issued property in DCAT-AP CH standard
dct_issued(date = Sys.Date(), hour_minutes_seconds = "00:00:00")dct_issued(date = Sys.Date(), hour_minutes_seconds = "00:00:00")
date |
date or character vector in yyyy-mm-dd format |
hour_minutes_seconds |
hour, minutes and seconds (default: "00:00:00") |
dct_issued(date = "2000-12-31", hour_minutes_seconds = "10:00:00")dct_issued(date = "2000-12-31", hour_minutes_seconds = "10:00:00")
Create a dct:language property in DCAT-AP CH standard
dct_language(language = c("de", "fr", "it", "en")) dct_language2(language = c("FRA", "ITA", "DEU", "ENG"))dct_language(language = c("de", "fr", "it", "en")) dct_language2(language = c("FRA", "ITA", "DEU", "ENG"))
language |
a language code of 3 letters. See https://handbook.opendata.swiss/de/content/glossar/bibliothek/dcat-ap-ch.html#dcat-distribution-language and https://publications.europa.eu/resource/authority/language |
dct_language(language = "de") dct_language(language = "fr") dct_language(language = "it") dct_language(language = "en") dct_language2("ENG")dct_language(language = "de") dct_language(language = "fr") dct_language(language = "it") dct_language(language = "en") dct_language2("ENG")
Create a dct:license property in DCAT-AP CH standard
dct_license(about = "http://dcat-ap.ch/vocabulary/licenses/terms_open") dct_license2( license = c("NonCommercialAllowed-CommercialAllowed-ReferenceNotRequired", "NonCommercialAllowed-CommercialAllowed-ReferenceRequired", "NonCommercialAllowed-CommercialWithPermission-ReferenceNotRequired", "NonCommercialAllowed-CommercialWithPermission-ReferenceRequired") ) dct_license3( license = c("http://dcat-ap.ch/vocabulary/licenses/terms_open", "http://dcat-ap.ch/vocabulary/licenses/terms_by", "http://dcat-ap.ch/vocabulary/licenses/terms_ask", "http://dcat-ap.ch/vocabulary/licenses/terms_by_ask") )dct_license(about = "http://dcat-ap.ch/vocabulary/licenses/terms_open") dct_license2( license = c("NonCommercialAllowed-CommercialAllowed-ReferenceNotRequired", "NonCommercialAllowed-CommercialAllowed-ReferenceRequired", "NonCommercialAllowed-CommercialWithPermission-ReferenceNotRequired", "NonCommercialAllowed-CommercialWithPermission-ReferenceRequired") ) dct_license3( license = c("http://dcat-ap.ch/vocabulary/licenses/terms_open", "http://dcat-ap.ch/vocabulary/licenses/terms_by", "http://dcat-ap.ch/vocabulary/licenses/terms_ask", "http://dcat-ap.ch/vocabulary/licenses/terms_by_ask") )
about |
a dct:license uri. See https://www.dcat-ap.ch/vocabulary/licenses/20210623.html |
license |
one of the licenses allowed in opendata.swiss See also https://dcat-ap.ch/vocabulary/licenses/20210623.html#terms_open for a list of possible licenses. |
dct_license( about = "http://dcat-ap.ch/vocabulary/licenses/terms_open" ) dct_license3("http://dcat-ap.ch/vocabulary/licenses/terms_by")dct_license( about = "http://dcat-ap.ch/vocabulary/licenses/terms_open" ) dct_license3("http://dcat-ap.ch/vocabulary/licenses/terms_by")
Create a dct:modified property in DCAT-AP CH standard
dct_modified(date = Sys.Date(), hour_minutes_seconds = "00:00:00")dct_modified(date = Sys.Date(), hour_minutes_seconds = "00:00:00")
date |
date or character vector in yyyy-mm-dd format |
hour_minutes_seconds |
hour, minutes and seconds (default: "00:00:00") |
dct_modified(date = "2001-12-31", hour_minutes_seconds = "10:00:00")dct_modified(date = "2001-12-31", hour_minutes_seconds = "10:00:00")
dct_publisher() is modeled as a foaf:Organization,
dct_publisher2() is modelled as a foaf:Agent in accordance with
DCAT-AP CH v2. dct_publisher2() allows the specification of the
foaf:name in more languages.
dct_publisher( publisher = "https://www.ti.ch/ustat", foaf_name = "Ufficio di statistica del Cantone Ticino (Ustat)" ) dct_publisher2( publisher = "https://www.ti.ch/ustat", foaf_name = "Ufficio di statistica del Cantone Ticino (Ustat)", language = "it" )dct_publisher( publisher = "https://www.ti.ch/ustat", foaf_name = "Ufficio di statistica del Cantone Ticino (Ustat)" ) dct_publisher2( publisher = "https://www.ti.ch/ustat", foaf_name = "Ufficio di statistica del Cantone Ticino (Ustat)", language = "it" )
publisher |
character string with a publisher (usually an URL) |
foaf_name |
name of the organization/publisher |
language |
language of foaf:name. Can be one or more of "de", "fr", "it" or "en". Must have the same length as foaf_name. |
dct_publisher( publisher = "https://www.ti.ch/ustat", foaf_name = "Ufficio di statistica del Cantone Ticino (Ustat)" ) dct_publisher2( publisher = "https://www.ti.ch/ustat", foaf_name = "Ufficio di statistica del Cantone Ticino (Ustat)", language = "it" )dct_publisher( publisher = "https://www.ti.ch/ustat", foaf_name = "Ufficio di statistica del Cantone Ticino (Ustat)" ) dct_publisher2( publisher = "https://www.ti.ch/ustat", foaf_name = "Ufficio di statistica del Cantone Ticino (Ustat)", language = "it" )
Create a dct:rights property in DCAT-AP CH standard
dct_rights( license = c("NonCommercialAllowed-CommercialAllowed-ReferenceNotRequired", "NonCommercialAllowed-CommercialAllowed-ReferenceRequired", "NonCommercialAllowed-CommercialWithPermission-ReferenceNotRequired", "NonCommercialAllowed-CommercialWithPermission-ReferenceRequired") )dct_rights( license = c("NonCommercialAllowed-CommercialAllowed-ReferenceNotRequired", "NonCommercialAllowed-CommercialAllowed-ReferenceRequired", "NonCommercialAllowed-CommercialWithPermission-ReferenceNotRequired", "NonCommercialAllowed-CommercialWithPermission-ReferenceRequired") )
license |
one of the licenses allowed in opendata.swiss See also https://dcat-ap.ch/vocabulary/licenses/20210623.html#terms_open for a list of possible licenses. |
dct_rights( license = "NonCommercialAllowed-CommercialAllowed-ReferenceRequired" )dct_rights( license = "NonCommercialAllowed-CommercialAllowed-ReferenceRequired" )
Create a dct:spatial property in DCAT-AP CH standard
dct_spatial(x = "Switzerland")dct_spatial(x = "Switzerland")
x |
spatial reference (default: "Switzerland") |
dct_spatial(x = "Switzerland")dct_spatial(x = "Switzerland")
Create a dct:temporal property in DCAT-AP CH standard
dct_temporal(startDate = Sys.Date() - 1, endDate = Sys.Date())dct_temporal(startDate = Sys.Date() - 1, endDate = Sys.Date())
startDate |
start date (default: Sys.Date() - 1). Date in yyyy-mm-dd format |
endDate |
end date (default: Sys.Date()). Date in yyyy-mm-dd format |
dct_temporal( startDate = "2000-12-31", endDate = "2010-12-31" )dct_temporal( startDate = "2000-12-31", endDate = "2010-12-31" )
Create a dct:title property in DCAT-AP CH standard
dct_title(title = "", language = "it")dct_title(title = "", language = "it")
title |
character string with a title |
language |
language of the title (one of "it", "de", "fr", "en") Mandatory property of |
dct_title(title = "This is a title", language = "en")dct_title(title = "This is a title", language = "en")
A closure to create a function that generates a tag like
f_gen_tag(tag = "dct:identifier")f_gen_tag(tag = "dct:identifier")
tag |
character string with the desired tag |
# Create an f function to generate a dct:identifier tag f <- f_gen_tag(tag = "dct:identifier") f(x = "an_identifier") rm(f)# Create an f function to generate a dct:identifier tag f <- f_gen_tag(tag = "dct:identifier") f(x = "an_identifier") rm(f)
A closure to create a function that generates a tag like
f_gen_tag2(tag = "dcat:accessURL", rdf_resource = "rdf:resource")f_gen_tag2(tag = "dcat:accessURL", rdf_resource = "rdf:resource")
tag |
character string with the desired tag |
rdf_resource |
character string that comes afer the tag (default: "rdf:resource") |
# Create an f function to generate a dcat:accessURL tag f <- f_gen_tag2(tag = "dcat:accessURL") f(x = "https://www.example.com") rm(f)# Create an f function to generate a dcat:accessURL tag f <- f_gen_tag2(tag = "dcat:accessURL") f(x = "https://www.example.com") rm(f)
Create a foaf:homepage tag
foaf_homepage(x = "http://www.example.com")foaf_homepage(x = "http://www.example.com")
x |
an url of a homepage |
foaf_homepage(x = "http://www.example.com")foaf_homepage(x = "http://www.example.com")
Generate a tag like
gen_tag(tag = "dct:identifier", x = "...")gen_tag(tag = "dct:identifier", x = "...")
tag |
character string with the desired tag |
x |
the content to be encapsulated inside the tag |
gen_tag(tag = "dct:identifier", x = "ti-ustat-cubi_pol_01@ustat")gen_tag(tag = "dct:identifier", x = "ti-ustat-cubi_pol_01@ustat")
Generate a tag like
gen_tag2( tag = "dcat:accessURL", x = "https://example.com", rdf_resource = "rdf:resource" )gen_tag2( tag = "dcat:accessURL", x = "https://example.com", rdf_resource = "rdf:resource" )
tag |
character string with the desired tag |
x |
the content to be encapsulated inside the tag. Note that this content is enclosed in quotation marks (by the function) |
rdf_resource |
character string that comes afer the tag (default: "rdf:resource") |
gen_tag2( tag = "dcat:accessURL", x = "https://example.com", rdf_resource = "rdf:resource" )gen_tag2( tag = "dcat:accessURL", x = "https://example.com", rdf_resource = "rdf:resource" )
Prepare a dataset to be exported in rdf/xml
rdf_dataset( dataset = dcat_dataset(), namespaces = c("xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"", "xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"", "xmlns:hydra=\"http://www.w3.org/ns/hydra/core#\"", "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"", "xmlns:dcat=\"http://www.w3.org/ns/dcat#\"", "xmlns:dct=\"http://purl.org/dc/terms/\"", "xmlns:vcard=\"http://www.w3.org/2006/vcard/ns#\"", "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\"", "xmlns:schema=\"http://schema.org/\"") )rdf_dataset( dataset = dcat_dataset(), namespaces = c("xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"", "xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"", "xmlns:hydra=\"http://www.w3.org/ns/hydra/core#\"", "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"", "xmlns:dcat=\"http://www.w3.org/ns/dcat#\"", "xmlns:dct=\"http://purl.org/dc/terms/\"", "xmlns:vcard=\"http://www.w3.org/2006/vcard/ns#\"", "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\"", "xmlns:schema=\"http://schema.org/\"") )
dataset |
a dataset created with |
namespaces |
character vector with xml/rdf namespaces |
Create a character vector with some xml/rdf namespaces
rdf_namespaces( namespaces = c("xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"", "xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"", "xmlns:hydra=\"http://www.w3.org/ns/hydra/core#\"", "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"", "xmlns:dcat=\"http://www.w3.org/ns/dcat#\"", "xmlns:dct=\"http://purl.org/dc/terms/\"", "xmlns:vcard=\"http://www.w3.org/2006/vcard/ns#\"", "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\"", "xmlns:schema=\"http://schema.org/\""), nspaces = 2L )rdf_namespaces( namespaces = c("xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"", "xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"", "xmlns:hydra=\"http://www.w3.org/ns/hydra/core#\"", "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"", "xmlns:dcat=\"http://www.w3.org/ns/dcat#\"", "xmlns:dct=\"http://purl.org/dc/terms/\"", "xmlns:vcard=\"http://www.w3.org/2006/vcard/ns#\"", "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\"", "xmlns:schema=\"http://schema.org/\""), nspaces = 2L )
namespaces |
character vector with xml/rdf namespaces |
nspaces |
number of spaces to indent (default: 2) |
Write a character vector to a file with unix file endings and UTF-8 encoding
write_unix(x, filename)write_unix(x, filename)
x |
a character vector |
filename |
filename |