Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 617793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:28:28+00:00 2026-05-13T18:28:28+00:00

I’ve run into an issue which I’m not sure if I can get round

  • 0

I’ve run into an issue which I’m not sure if I can get round or not. My library and another library both provide an API for a particular type of data and I’ve now written an interop library that can sit between the two libraries and convert data freely between them which works great.

BUT I’ve now tried to write a small demo app of accessing data via my API using a third library which relies on the other API and here’s where I hit issues. The third library references a merged version of the other API and some associated DLLs which to boot is an old version of the other API while my API references the latest version of the other API in it’s standalone form. So to start with I have to use an external alias to even write code with the 3 libraries together as otherwise types clash and it won’t compile.

So now when I try and write an app which takes data from my API, runs it through the interop layer so it’s transformed into the other API and then uses the third library on this data things fall apart as .Net won’t convert between the types as it considers them different. Is there any way to force .Net to do this or am I out of luck?

As I understand it the author of the third library plans to move his library to be based on the latest version (1.0.6.4) of the other API in the future so I may just have to wait until then?

using System;
using System.Collections.Generic;
using System.Linq;
using VDS.RDF;
using VDS.RDF.Interop;
using VDS.RDF.Parsing;
using VDS.RDF.Storage;
using SemWeb;
using LinqToRdf;

namespace RdfMusic
{
    public class Program
    {
        public static void Main(string[] args)
        {
            try
            {
                //Get the Talis Connection
                TalisPlatformConnector talis = new TalisPlatformConnector("store", "user", "password");
                NativeStoreSource source = new NativeStoreSource(talis);

                //Load the Data
                Graph g = new Graph();
                FileLoader.Load(g, "data.ttl");

                //Ensure the data is in Talis
                talis.SaveGraph(g);

                //Now do a LinqToRdf query
                //BUG: This cast fails since it's trying to cast to StatementSource in 
                //the SemWeb library (version 1.0.5.0 as referenced by LinqToRdf) from
                //a StatementSource in the SemWeb library (version 1.0.6.4 as referenced by dotNetRDF)
                StatementSource stmtSource = (StatementSource)source;
                LinqToRdf.TripleStore ts = new LinqToRdf.TripleStore(new Store(stmtSource));
                ts.QueryType = QueryType.LocalN3StoreInMemory;

                IEnumerable<Track> tracks = from t in new MusicDataContext(ts).ForType<Track>()
                                            where t.Year == "2006"
                                            select t;

                foreach (Track t in tracks)
                {
                    Console.Write(t.Title + " by " + t.ArtistName);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.WriteLine(ex.StackTrace);
                Exception innerEx = ex.InnerException;
                while (innerEx != null)
                {
                    Console.WriteLine();
                    Console.WriteLine(innerEx.Message);
                    Console.WriteLine(innerEx.StackTrace);
                    innerEx = innerEx.InnerException;
                }
            }

            Console.WriteLine();
            Console.WriteLine("Press Enter to exit");
            Console.ReadLine();
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:28:28+00:00Added an answer on May 13, 2026 at 6:28 pm

    Yes, you’re out of luck. From CLR point of view, a type name is assembly name + optional module name + type name (this includes namespaces and outer classes), and the system is nominal, not structural – different name means different type. The best you can do is convert manually, insofar as you can given accessibility of members (or just work around it using reflection).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.