Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2m-atl-dev] Transforming XML to RDFS

Hi all,

I am very new to ATL and am currently trying my hand at transforming RDFS XML to RDFS ecore. I am wondering if someone can help me with a part of this transformation i am having trouble with.

I have the following rule to find where rdfs:cClass is defined in XML and converting to RDFS class in a RDFS ecore model:
rule Class2Class {
   from
       pt: XML!Element(
           pt.name = 'rdfs:Class'
) to
       c : RDFS!Class(uriRef <-uri),
       uri : RDFS!URIReference ( uri <- u_r_i ),
u_r_i : RDFS!UniformResourceIdentifier ( name <- pt.children->select( e | e.name = 'rdf:ID')->first().value)
}

Now what I want to do is transform resources in the RDFS. To do this I would like to classify each resource into an rdfs:Class. So basically I would like to do the following

Rule instance2instance{
   from
       pt: XML!Element(
           pt.name = < Class c (from Class2Class) uriRef >
) to
       c : RDFS!Resource(
           uriRef <-uri,
           type <- <class c (from Class2Class)>
           ),
       uri : RDFS!URIReference ( uri <- u_r_i ),
u_r_i : RDFS!UniformResourceIdentifier ( name <- pt.children->select( e | e.name = 'rdf:ID')->first().value)
}

If you need any additional info please let me know, I hope this makes sense. Any help would be much appreciated!!!

Thanks,
Mark


Back to the top