# released-replacements-for-custom-view.rq # ----------------------------------------------------------------------------- # For a custom Z-view, find every released (C2) view whose field signature # overlaps with it — the candidate replacements Atlas would suggest during # a conversion. # # Parameters: # $customView — name of the custom view (e.g. "ZI_CustomerCustom") PREFIX atlas: PREFIX sap: PREFIX rdfs: SELECT ?candidate ?candidateLabel ?contract (COUNT(DISTINCT ?sharedField) AS ?overlap) WHERE { ?custom a sap:CDSView ; rdfs:label $customView ; sap:hasField ?customField . ?customField sap:fieldRole ?role ; rdfs:label ?fieldName . ?candidate a sap:CDSView ; rdfs:label ?candidateLabel ; sap:hasField ?sharedField ; sap:hasReleaseContract ?contractNode . ?contractNode sap:hasReleaseState "C2" ; rdfs:label ?contract . ?sharedField sap:fieldRole ?role ; rdfs:label ?fieldName . FILTER (?candidate != ?custom) FILTER (strstarts(?candidateLabel, "A_") || strstarts(?candidateLabel, "I_")) } GROUP BY ?candidate ?candidateLabel ?contract HAVING (COUNT(DISTINCT ?sharedField) >= 3) ORDER BY DESC(?overlap) LIMIT 5