ISOSRVServiceIdentification

ISOSRVServiceIdentification

Format

R6Class object.

Value

Object of R6Class for modelling an ISO ServiceIdentification

References

ISO 19119:2005 - Geographic information – Services

Author

Emmanuel Blondel <emmanuel.blondel1@gmail.com>

Public fields

serviceType

serviceType [1..1]: ISOGenericName

serviceTypeVersion

serviceTypeVersion [0..*]: character

accessProperties

accessProperties [0..1]: ISOStandardOrderProcess

restrictions

restrictions [0..1]: ISOConstraints

keywords

keywords [0..*]: ISOKeywords

extent

extent [0..*]: ISOExtent

coupledResource

coupledResource [0..*]: ISOCoupledResource

couplingType

couplingType [1..1]: ISOCouplingType

containsOperations

containsOperations [1..*]: ISOOperationMetadata

operatesOn

operatesOn [0..*]: ISODataIdentification

Methods

Inherited methods


Method new()

Initializes object

Usage

Arguments

xml

object of class XMLInternalNode-class


Method setServiceType()

Set service type

Usage

ISOSRVServiceIdentification$setServiceType(serviceType)

Arguments

serviceType

object of class ISOLocalName, ISOScopedName or character


Method addServiceTypeVersion()

Adds service type version

Usage

ISOSRVServiceIdentification$addServiceTypeVersion(version)

Arguments

version

version

Returns

TRUE if added, FALSE otherwise


Method delServiceTypeVersion()

Deletes service type version

Usage

ISOSRVServiceIdentification$delServiceTypeVersion(version)

Arguments

version

version

Returns

TRUE if deleted, FALSE otherwise


Method setAccessProperties()

Set access properties

Usage

ISOSRVServiceIdentification$setAccessProperties(accessProperties)

Arguments

accessProperties

object of class ISOStandardOrderProcess


Method setRestrictions()

Set restrictions

Usage

ISOSRVServiceIdentification$setRestrictions(restrictions)

Arguments

restrictions

object of class ISOConstraints


Method addKeywords()

Adds keywords

Usage

ISOSRVServiceIdentification$addKeywords(keywords)

Arguments

keywords

object of class ISOKeywords

Returns

TRUE if added, FALSE otherwise


Method delKeywords()

Deletes keywords

Usage

ISOSRVServiceIdentification$delKeywords(keywords)

Arguments

keywords

object of class ISOKeywords

Returns

TRUE if deleted, FALSE otherwise


Method addExtent()

Adds extent

Usage

ISOSRVServiceIdentification$addExtent(extent)

Arguments

extent

object of class ISOExtent

Returns

TRUE if added, FALSE otherwise


Method delExtent()

Deletes extent

Usage

ISOSRVServiceIdentification$delExtent(extent)

Arguments

extent

object of class ISOExtent

Returns

TRUE if deleted, FALSE otherwise


Method addCoupledResource()

Adds coupled resource

Usage

ISOSRVServiceIdentification$addCoupledResource(resource)

Arguments

resource

object of class ISOCoupledResource

Returns

TRUE if added, FALSE otherwise


Method delCoupledResource()

Deletes coupled resource

Usage

ISOSRVServiceIdentification$delCoupledResource(resource)

Arguments

resource

object of class ISOCoupledResource

Returns

TRUE if deleted, FALSE otherwise


Method setCouplingType()

Set coupling type

Usage

ISOSRVServiceIdentification$setCouplingType(couplingType)

Arguments

couplingType

object of class ISOCouplingType or any character among values returned by ISOCouplingType$values()


Method addOperationMetadata()

Adds operation metadata

Usage

ISOSRVServiceIdentification$addOperationMetadata(operationMetadata)

Arguments

operationMetadata

object of class ISOOperationMetadata

Returns

TRUE if added, FALSE otherwise


Method delOperationMetadata()

Deletes operation metadata

Usage

ISOSRVServiceIdentification$delOperationMetadata(operationMetadata)

Arguments

operationMetadata

object of class ISOOperationMetadata

Returns

TRUE if deleted, FALSE otherwise


Method addOperatesOn()

Adds operates on

Usage

ISOSRVServiceIdentification$addOperatesOn(dataIdentification)

Arguments

dataIdentification

object of class ISODataIdentification

Returns

TRUE if added, FALSE otherwise


Method delOperatesOn()

Deletes operates on

Usage

ISOSRVServiceIdentification$delOperatesOn(dataIdentification)

Arguments

dataIdentification

object of class ISODataIdentification

Returns

TRUE if deleted, FALSE otherwise


Method clone()

The objects of this class are cloneable with this method.

Usage

ISOSRVServiceIdentification$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

  #encoding
  md <- ISOSRVServiceIdentification$new()
  md$setAbstract("abstract")
  md$setPurpose("purpose")

  #adding a point of contact
  rp <- ISOResponsibleParty$new()
  rp$setIndividualName("someone")
  rp$setOrganisationName("somewhere")
  rp$setPositionName("someposition")
  rp$setRole("pointOfContact")
  contact <- ISOContact$new()
  phone <- ISOTelephone$new()
  phone$setVoice("myphonenumber")
  phone$setFacsimile("myfacsimile")
  contact$setPhone(phone)
  address <- ISOAddress$new()
  address$setDeliveryPoint("theaddress")
  address$setCity("thecity")
  address$setPostalCode("111")
  address$setCountry("France")
  address$setEmail("someone@theorg.org")
  contact$setAddress(address)
  res <- ISOOnlineResource$new()
  res$setLinkage("http://www.somewhereovertheweb.org")
  res$setName("somename")
  contact$setOnlineResource(res)
  rp$setContactInfo(contact)
  md$addPointOfContact(rp)
#> [1] TRUE

  #citation
  ct <- ISOCitation$new()
  ct$setTitle("sometitle")
  d <- ISODate$new()
  d$setDate(ISOdate(2015, 1, 1, 1))
  d$setDateType("publication")
  ct$addDate(d)
  ct$setEdition("1.0")
  ct$setEditionDate(ISOdate(2015,1,1))
  ct$addIdentifier(ISOMetaIdentifier$new(code = "identifier"))
#> [1] TRUE
  ct$addPresentationForm("mapDigital")
#> [1] TRUE
  ct$addCitedResponsibleParty(rp)
#> [1] TRUE
  md$setCitation(ct)

  #graphic overview
  go <- ISOBrowseGraphic$new(
    fileName = "http://wwww.somefile.org/png",
    fileDescription = "Map Overview",
    fileType = "image/png"
  )
  md$addGraphicOverview(go)
#> [1] TRUE

  #maintenance information
  mi <- ISOMaintenanceInformation$new()
  mi$setMaintenanceFrequency("daily")
  md$addResourceMaintenance(mi)
#> [1] TRUE

  #adding legal constraints
  lc <- ISOLegalConstraints$new()
  lc$addUseLimitation("limitation1")
#> [1] TRUE
  lc$addUseLimitation("limitation2")
#> [1] TRUE
  lc$addUseLimitation("limitation3")
#> [1] TRUE
  lc$addAccessConstraint("copyright")
#> [1] TRUE
  lc$addAccessConstraint("license")
#> [1] TRUE
  lc$addUseConstraint("copyright")
#> [1] TRUE
  lc$addUseConstraint("license")
#> [1] TRUE
  md$addResourceConstraints(lc)
#> [1] TRUE

  #specific elements to service identification
  md$setServiceType("Fishery data harmonization process")
  md$addServiceTypeVersion("1.0")
#> [1] TRUE
  orderProcess <- ISOStandardOrderProcess$new()
  orderProcess$setFees("fees")
  orderProcess$setPlannedAvailableDateTime(ISOdate(2017,7,5,12,0,0))
  orderProcess$setOrderingInstructions("instructions")
  orderProcess$setTurnaround("turnaround")
  md$setAccessProperties(orderProcess)
  md$setRestrictions(lc)

  kwds <- ISOKeywords$new()
  kwds$addKeyword("keyword1")
#> [1] TRUE
  kwds$addKeyword("keyword2")
#> [1] TRUE
  kwds$setKeywordType("theme")
  th <- ISOCitation$new()
  th$setTitle("General")
  th$addDate(d)
  kwds$setThesaurusName(th)
  md$addKeywords(kwds)
#> [1] TRUE

  #adding extent
  extent <- ISOExtent$new()
  bbox <- ISOGeographicBoundingBox$new(minx = -180, miny = -90, maxx = 180, maxy = 90)
  extent$addGeographicElement(bbox)
#> [1] TRUE
  md$addExtent(extent)
#> [1] TRUE

  #coupling type
  #(here "tight" associated with a particular dataset "my-dataset-identifier")
  #see ISOCouplingType$values(labels = T) for other values
  md$setCouplingType("tight")
  coupledDataset1 <- ISOCoupledResource$new()
  coupledDataset1$setOperationName("Rscript")
  coupledDataset1$setIdentifier("my-dataset-identifier")
  coupledDataset2 <- ISOCoupledResource$new()
  coupledDataset2$setOperationName("WPS:Execute")
  coupledDataset2$setIdentifier("my-dataset-identifier")
  md$addCoupledResource(coupledDataset1)
#> [1] TRUE
  md$addCoupledResource(coupledDataset2)
#> [1] TRUE

  #add operation metadata 1 (Rscript)
  scriptOp <- ISOOperationMetadata$new()
  scriptOp$setOperationName("Rscript")
  scriptOp$addDCP("WebServices")
#> [1] TRUE
  scriptOp$setOperationDescription("WPS Execute")
  scriptOp$setInvocationName("identifier")
  for(i in 1:3){
    param <- ISOParameter$new()
    param$setName(sprintf("name%s",i), "xs:string")
    param$setDirection("in")
    param$setDescription(sprintf("description%s",i))
    param$setOptionality(FALSE)
    param$setRepeatability(FALSE)
    param$setValueType("xs:string")
    scriptOp$addParameter(param)
  }
#> Error: object 'ISOParameter' not found
  outParam <-ISOParameter$new()
#> Error: object 'ISOParameter' not found
  outParam$setName("outputname", "xs:string")
#> Error: object 'outParam' not found
  outParam$setDirection("out")
#> Error: object 'outParam' not found
  outParam$setDescription("outputdescription")
#> Error: object 'outParam' not found
  outParam$setOptionality(FALSE)
#> Error: object 'outParam' not found
  outParam$setRepeatability(FALSE)
#> Error: object 'outParam' not found
  outParam$setValueType("xs:string")
#> Error: object 'outParam' not found
  scriptOp$addParameter(outParam)
#> Error: object 'outParam' not found
  or <- ISOOnlineResource$new()
  or$setLinkage("http://somelink/myrscript.R")
  or$setName("R script name")
  or$setDescription("R script description")
  or$setProtocol("protocol")
  scriptOp$addConnectPoint(or)
#> [1] TRUE
  md$addOperationMetadata(scriptOp)
#> [1] TRUE
  #add operation metadata 1 (WPS)
  wpsOp <- ISOOperationMetadata$new()
  wpsOp$setOperationName("WPS:Execute")
  wpsOp$addDCP("WebServices")
#> [1] TRUE
  wpsOp$setOperationDescription("WPS Execute")
  invocationName <- "mywpsidentifier"
  wpsOp$setInvocationName(invocationName)
  for(i in 1:3){
    param <- ISOParameter$new()
    param$setName(sprintf("name%s",i), "xs:string")
    param$setDirection("in")
    param$setDescription(sprintf("description%s",i))
    param$setOptionality(FALSE)
    param$setRepeatability(FALSE)
    param$setValueType("xs:string")
    wpsOp$addParameter(param)
  }
#> Error: object 'ISOParameter' not found
  outParam <-ISOParameter$new()
#> Error: object 'ISOParameter' not found
  outParam$setName("outputname", "xs:string")
#> Error: object 'outParam' not found
  outParam$setDirection("out")
#> Error: object 'outParam' not found
  outParam$setDescription("outputdescription")
#> Error: object 'outParam' not found
  outParam$setOptionality(FALSE)
#> Error: object 'outParam' not found
  outParam$setRepeatability(FALSE)
#> Error: object 'outParam' not found
  outParam$setValueType("xs:string")
#> Error: object 'outParam' not found
  wpsOp$addParameter(outParam)
#> Error: object 'outParam' not found
  or1 <- ISOOnlineResource$new()
  or1$setLinkage(
    sprintf("http://somelink/wps?request=Execute&version=1.0.0&Identifier=%s",
    invocationName)
  )
  or1$setName("WPS process name")
  or1$setDescription("WPS process description")
  or1$setProtocol("protocol")
  wpsOp$addConnectPoint(or1)
#> [1] TRUE
  or2 <- ISOOnlineResource$new()
  or2$setLinkage("http://somelink/myrscript.R")
  or2$setName("Source R script name")
  or2$setDescription("Source R script description")
  or2$setProtocol("protocol")
  wpsOp$addConnectPoint(or2)
#> [1] TRUE
  md$addOperationMetadata(wpsOp)
#> [1] TRUE
  xml <- md$encode()
#> [geometa][WARN] Element '{http://www.isotc211.org/2005/srv}SV_ServiceIdentification': No matching global declaration available for the validation root at line 1. 
#> [geometa][WARN] Object 'ISOSRVServiceIdentification' is INVALID according to ISO 19139 XML schemas!