prefixes:
  acl: http://www.w3.org/ns/auth/acl#
  e: http://myontology.com/
  ex: http://www.example.com/
  schema: http://schema.org/

sources:
  source-people: ['people.csv~csv']
  source-people-acl: ['people-acl.csv~csv']

targets:
  target-people-data:
    type: directhttprequest
    access: http://localhost:3000/people-data
    serialization: turtle
    authentication: auth1

authentications:
  auth1:
    type: cssclientcredentials
    email: test@example.com
    password: secret!
    webId: http://localhost:3000/profile/card#me
    oidcIssuer: http://localhost:3000/

mappings:
  people:
    sources:
      - source-people
    s:
      value: ex:$(person_id)
      targets:
        - target-people-data
    po:
      - [a, schema:Person]
      - [schema:givenName, $(firstname)]
      - [schema:familyName, $(lastname)]

  people-acl:
    sources:
      - source-people-acl
    s:
      value: ex:acl_$(id_acl)
    po:
      - [ a, acl:Authorization~iri ]
      - [ acl:accessTo, http://localhost:3000/people-data~iri ]
      - p: acl:mode
        o: acl:Read~iri
        condition:
          function: equal
          parameters:
            - [ str1, $(read_access) ]
            - [ str2, Yes ]
      - p: acl:mode
        o: acl:Write~iri
        condition:
          function: equal
          parameters:
            - [ str1, $(write_access) ]
            - [ str2, Yes ]
      - p: acl:mode
        o: acl:Control~iri
        condition:
          function: equal
          parameters:
            - [ str1, $(control_access) ]
            - [ str2, Yes ]
      - p: acl:agent
        o:
          value: $(agent_webid)
          type: iri
      - p: acl:agentClass
        o:
          value: $(agent_class)
          type: iri
