Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to represent one-to-many and nested relationships #179

Open
qzc438 opened this issue Oct 25, 2022 · 6 comments
Open

How to represent one-to-many and nested relationships #179

qzc438 opened this issue Oct 25, 2022 · 6 comments

Comments

@qzc438
Copy link

qzc438 commented Oct 25, 2022

Issue type: ❓ Question

As shown in the excel query-result.csv, I am asking how to represent one-to-many and nested relationships:

  1. AHU1A has two sub-equipment VAV2-3 and VAV2-4.
  2. VAV2-4 has one sensor VAV2-4.DPR and this sensor have a sub-sensor VAV2-4.DPRPOS.
@bjdmeest
Copy link
Collaborator

See the example YARRRML below, does this answer your question?

prefixes:
  ex: "http://example.com/"
  idlab-fn: "http://example.com/idlab/function/"
  grel: "http://users.ugent.be/~bjdmeest/function/grel.ttl#"

mappings:
  Equipment:
    sources:
      - ['data.csv~csv']
    s: http://example.com/equiment/$(Equipment)
    po:
      - [a, ex:Equipment]
      - [ex:subEquipment, http://example.com/equiment/$(Sub-Equipment)~iri]
      - [ex:hasSensor, http://example.com/sensor/$(Sensor)~iri]
  Sensor:
    sources:
      - ['data.csv~csv']
    s: http://example.com/sensor/$(Sensor)
    po:
      - [a, ex:Sensor]
      - [ex:subSensor, http://example.com/sensor/$(Sub-Sensor)~iri]

@qzc438
Copy link
Author

qzc438 commented Nov 15, 2022

Can I know how to deal with the blank nodes in the sample query-result.csv?

@bjdmeest
Copy link
Collaborator

How do you mean? Empty values are by default seen as null values and thus skipped, conforming to the R2RML specification. Have you been able to try the example given above? In what way does its output not conform with your expectations?

@qzc438
Copy link
Author

qzc438 commented Nov 16, 2022

If you look at Line 2 and 3 in my CSV, AHU1A appears twice because it links to VAV-3 and VAV4. Will it occur as a duplicate definition in [a, ex:Equipment]?

@bjdmeest
Copy link
Collaborator

The resulting graph might contain duplicates, but mapping engines could filter out duplicates, see eg https://github.com/RMLio/rmlmapper-java#duplicate-removal-and-serialization-format.

@qzc438
Copy link
Author

qzc438 commented Nov 17, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants