CELLFIE : import many values from a cell

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CELLFIE : import many values from a cell

pimpre
Hello,
I've been trying to import a xlsx file which have a column for location.
There can be one or several regions in this column, separated by comma



I couldn't find a way with the transformations to import each and every of those regions for an instance instead of the first one only.
Moreover, it seems the comma and dash signs are "stripped" away by the transformation engine..

Example:
Cadet;Loire,Rhône;
Calceferia;Rhône-Alpes,Languedoc-Roussillon

With transformation :
Individual: @A*  
  Facts: localisation  @D*(mm:capturing("(\p{L}+\-?\p{L}+)\s?,?"))

The desired result would be :

Cadet localisation some Loire
Cadet localisation some Rhône
Calcefaria localisation some Rhône-Alpes
Calcefaria localisation some Languedoc-Roussillon

Instead I have :

Cadet localisation some Loire
Calcefaria localisation some RhôneAlpes

What's the right way to do it ?

Regards,

Pimpr
Reply | Threaded
Open this post in threaded view
|

Re: CELLFIE : import many values from a cell

Josef Hardi
Hi Pimpr,

This is a known bug reported in https://github.com/protegeproject/cellfie-plugin/issues/45. We’re working to fix it and will have a new release at the end of this month.


Best,
Josef

On Feb 21, 2016, at 1:21 PM, pimpre <[hidden email]> wrote:

Hello,
I've been trying to import a xlsx file which have a column for location.
There can be one or several regions in this column, separated by comma

<http://protege-project.136.n4.nabble.com/file/n4664507/cap.png>

I couldn't find a way with the transformations to import each and every of
those regions for an instance instead of the first one only.
Moreover, it seems the comma and dash signs are "stripped" away by the
transformation engine..

Example:
Cadet;Loire,Rhône;
Calceferia;Rhône-Alpes,Languedoc-Roussillon

With transformation :
Individual: @A*  
 Facts: localisation  @D*(mm:capturing("(\p{L}+\-?\p{L}+)\s?,?"))

The desired result would be :

Cadet localisation some Loire
Cadet localisation some Rhône
Calcefaria localisation some Rhône-Alpes
Calcefaria localisation some Languedoc-Roussillon

Instead I have :

Cadet localisation some Loire
Calcefaria localisation some RhôneAlpes

What's the right way to do it ?

Regards,

Pimpr




--
View this message in context: http://protege-project.136.n4.nabble.com/CELLFIE-import-many-values-from-a-cell-tp4664507.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: CELLFIE : import many values from a cell

pimpre
Thank you Josef :)
Reply | Threaded
Open this post in threaded view
|

Re: CELLFIE : import many values from a cell

Martin O'Connor-2
In reply to this post by Josef Hardi

There is a deeper problem here, though. Mapping Master does not currently expand multiple values from a reference to generate an assertion from each extracted value. Each reference is replaced with one value only. 

Also, the Java-based capturing expressions implementation that Mapping Master uses does not support a variable number of groups:


You can do something like:

 Individual: @A2 
  Types: Person 
  Facts: hasForename @A2(["(\S+)"]), 
         hasInitial @A2(["\S+\s(\S+)"]), 
         hasSurname @A2(["\S+\s\S+\s(\S+)"]) 

In your case you could repeat the same property value several times (and dropping would take care of non-matches; see https://github.com/protegeproject/mapping-master/wiki/MappingMasterDSL#missing-value-handling) but there is currently no obvious way to extract the variable number of matches that you require.

Martin

On Feb 22, 2016, at 9:59 AM, Josef Hardi <[hidden email]> wrote:

Hi Pimpr,

This is a known bug reported in https://github.com/protegeproject/cellfie-plugin/issues/45. We’re working to fix it and will have a new release at the end of this month.


Best,
Josef

On Feb 21, 2016, at 1:21 PM, pimpre <[hidden email]> wrote:

Hello,
I've been trying to import a xlsx file which have a column for location.
There can be one or several regions in this column, separated by comma

<http://protege-project.136.n4.nabble.com/file/n4664507/cap.png>

I couldn't find a way with the transformations to import each and every of
those regions for an instance instead of the first one only.
Moreover, it seems the comma and dash signs are "stripped" away by the
transformation engine..

Example:
Cadet;Loire,Rhône;
Calceferia;Rhône-Alpes,Languedoc-Roussillon

With transformation :
Individual: @A*  
 Facts: localisation  @D*(mm:capturing("(\p{L}+\-?\p{L}+)\s?,?"))

The desired result would be :

Cadet localisation some Loire
Cadet localisation some Rhône
Calcefaria localisation some Rhône-Alpes
Calcefaria localisation some Languedoc-Roussillon

Instead I have :

Cadet localisation some Loire
Calcefaria localisation some RhôneAlpes

What's the right way to do it ?

Regards,

Pimpr




--
View this message in context: http://protege-project.136.n4.nabble.com/CELLFIE-import-many-values-from-a-cell-tp4664507.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user