public static IdentifierKind GetIdentifierKind(IIdentifier identifier) { var kind = IdentifierKind.Other; var parent2 = identifier.Parent; while (parent2 != null && !(parent2 is ISentence) && !(parent2 is IAnonymousIdentifier)) { if (parent2 is ISubject) { kind = IdentifierKind.Subject; break; } if (parent2 is IPredicate) { kind = IdentifierKind.Predicate; break; } if (parent2 is IObjects) { kind = IdentifierKind.Object; break; } parent2 = parent2.Parent; } return(kind); }
public static IdentifierInfo GetIdentifierInfo(IIdentifier identifier) { var kind = IdentifierKind.Other; var parent2 = identifier.Parent; while (parent2 != null && !(parent2 is ISentence) && !(parent2 is IAnonymousIdentifier)) { if (parent2 is ISubject) { kind = IdentifierKind.Subject; break; } if (parent2 is IPredicate) { kind = IdentifierKind.Predicate; break; } if (parent2 is IObjects) { kind = IdentifierKind.Object; break; } parent2 = parent2.Parent; } if (parent2 != null && kind == IdentifierKind.Subject) { var statement = parent2.Parent as IStatement; if (statement != null) { return(AnalizeStatement(statement)); } } return(new IdentifierInfo(kind)); }
public static IdentifierInfo GetIdentifierInfo(IIdentifier identifier) { var kind = IdentifierKind.Other; var parent2 = identifier.Parent; while (parent2 != null && !(parent2 is ISentence) && !(parent2 is IAnonymousIdentifier)) { if (parent2 is ISubject) { kind = IdentifierKind.Subject; break; } if (parent2 is IPredicate) { kind = IdentifierKind.Predicate; break; } if (parent2 is IObjects) { kind = IdentifierKind.Object; break; } parent2 = parent2.Parent; } if (parent2 != null && kind == IdentifierKind.Subject) { var statement = parent2.Parent as IStatement; if (statement != null) { return AnalizeStatement(statement); } } return new IdentifierInfo(kind); }
public static IdentifierKind GetIdentifierKind(IIdentifier identifier) { var kind = IdentifierKind.Other; var parent2 = identifier.Parent; while (parent2 != null && !(parent2 is ISentence) && !(parent2 is IAnonymousIdentifier)) { if (parent2 is ISubject) { kind = IdentifierKind.Subject; break; } if (parent2 is IPredicate) { kind = IdentifierKind.Predicate; break; } if (parent2 is IObjects) { kind = IdentifierKind.Object; break; } parent2 = parent2.Parent; } return kind; }