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

Default values hide intentionally missing attributes #13

Closed
mkllnk opened this issue Jan 11, 2024 · 2 comments · Fixed by #14
Closed

Default values hide intentionally missing attributes #13

mkllnk opened this issue Jan 11, 2024 · 2 comments · Fixed by #14

Comments

@mkllnk
Copy link
Contributor

mkllnk commented Jan 11, 2024

The connector initialises all semantic objects with defaults:

[template public getInitializationValueForType(type: String, upper: Integer)]
[if upper = -1]['[]'/][elseif type = 'String']""[elseif type = 'Boolean']false[elseif type = 'Integer']0[elseif type = 'Real']0.0[else]nil[/if]
[/template]

But with those defaults, we can't tell if the parameter was never set or set to the default value. This is especially problematic with stockLimiation. If a product doesn't have a stock limitation then the only way to indicate that is to omit the attribute.

When exporting data via the connector, you can override the default with nil and then the attribute will not appear in the output. But when importing RDF documents, we don't override every missing attribute with nil. Even if you add the attribute with a null value to the RDF document the parser will ignore it.

@lecoqlibre Do we need the default values? Or can we set them all to nil to mark them as unset.

@lecoqlibre
Copy link
Member

I guess it's OK to use nil instead the default value except for the semanticId property. Did you try it already @mkllnk? Especially when exporting/importing?

@mkllnk
Copy link
Contributor Author

mkllnk commented Jan 24, 2024

No, I haven't tried it. But I could work on a pull request.

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

Successfully merging a pull request may close this issue.

2 participants