Hello Christian.

I would substitute slashes (/ and \) too, they severely mess URIs!

Diogo F.C. PatrĂ£o
Manager of Medical Informatics
Biotechnology Laboratory
Hospital A.C. Camargo
http://www.accamargo.org.br/


On Fri, Jan 7, 2011 at 10:42 AM, Christian Brenninkmeijer <
[email protected]> wrote:

> Hi,
> I have been using MappingGenerator to create mapping files.
>
> In general a very useful tool until there is a space in a table name.
>
> Now I am not going to disagree with anyone who says that spaces in table
> names are ugly... (I didn't create the dataabase and there are too many
> tables to fix manually)
>
> My fix was to replace the spaces with underscores in the method
>
> de.fuberlin.wiwiss.d2rq.mapgen. MappingGenerator.uriPattern(RelationName
> tableName)
>
> replace the first line
>
>         String result = this.instanceNamespaceURI +
> tableName.qualifiedName();
>
> with
>
>         String result = this.instanceNamespaceURI +
> scrub(tableName.qualifiedName());
>
> then add a method
>
>     private String scrub (String text){
>         String newText = text.replace(" ", "_");
>
>          return newText;
>     }
>
> The scrub method can and should be extended to handle other difficult
> character but these are optional. Replacing the space is not.
> For example
>
>     private String scrub (String text){
>         String newText = text.replace(" ", "_");
>         newText = newText.replace("+", "Plus");
>         newText = newText.replace("-", "Minus");
>         newText = newText.replace("(", "_");
>         newText = newText.replace(")", "_");
>
>         return text;
>     }
>
> regards
> Dr Christian Brenninkmeijer
> University of manchester
>
>
>
> ------------------------------------------------------------------------------
> Gaining the trust of online customers is vital for the success of any
> company
> that requires sensitive data to be transmitted over the Web.   Learn how to
> best implement a security strategy that keeps consumers' information secure
> and instills the confidence they need to proceed with transactions.
> http://p.sf.net/sfu/oracle-sfdevnl
> _______________________________________________
> d2rq-map-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
>
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
d2rq-map-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel

Reply via email to